Private Sub mnuReportRoom_Click()
OpenTable frmMDI.adoRoom, "select * from Room order by RoomNo,RoomRate"
With DatareportRoom
Set .DataSource = frmMDI.adoRoom
.Caption = "房间基本情况表"
.Sections("Section1").Controls("txtRoomNo").DataField = "RoomNo"
.Sections("Section1").Controls("txtRoomGrade").DataField = "RoomGrade"
.Sections("Section1").Controls("txtRoomGrade").DataFormat.Type = 5
.Sections("Section1").Controls("txtRoomGrade").DataFormat.TrueValue = "标准间"
.Sections("Section1").Controls("txtRoomGrade").DataFormat.FalseValue = "豪华间"
.Sections("Section1").Controls("txtRoomGrade").DataFormat.NullValue = "未知"
.Sections("Section1").Controls("txtRoomType").DataField = "RoomType"
.Sections("Section1").Controls("txtRoomType").DataFormat.Type = 5
.Sections("Section1").Controls("txtRoomType").DataFormat.TrueValue = "单人间"
.Sections("Section1").Controls("txtRoomType").DataFormat.FalseValue = "双人间"
.Sections("Section1").Controls("txtRoomType").DataFormat.NullValue = "未知"
.Sections("Section1").Controls("txtRoomRate").DataField = "RoomRate"
.Sections("Section1").Controls("txtRoomStatus").DataField = "RoomStatus"
.Show
End With
End Sub
Public Sub OpenTable(pAdo As Adodc, pRecordSource As String)
With pAdo
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& App.Path _
& "\DB.mdb;Persist Security Info=False"
.CommandType = adCmdUnknown
.RecordSource = pRecordSource
.Refresh
End With
End Sub