6.3.3调房登记
Private Sub Form_Load()
'自动识别数据库路径
Data1.DatabaseName = App.Path & "\KFGL.MDB"
Data2.DatabaseName = App.Path & "\KFGL.MDB"
Data3.DatabaseName = App.Path & "\KFGL.MDB"
Data4.DatabaseName = App.Path & "\KFGL.MDB"
End Sub
Private Sub Form_Activate()
czy.Text = main.StatusBar1.Panels(4).Text '赋值给czy.text
'查询住宿登记信息
Data4.RecordSource = "select * from djb where 标志='1'"
Data4.Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True '设置主窗体有效
End Sub
Private Sub DBCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Texbz.SetFocus 'texbz获得焦点
End Sub
Private Sub DBCOMBO2_Change()
If DBCombo2.Text <> "" Then
Data1.Recordset.FindFirst "房间号='" & DBCombo2.Text & "'and 标志='1'"
If Data1.Recordset.NoMatch Then
MsgBox ("请核准住宿房间和住宿人!")
Else
If Data1.Recordset.Fields("客房类型") <> "" Then
With Data1.Recordset
'查询空闲房间
Data2.RecordSource = "select * from kf where 房间类型='" & .Fields("客房类型") & "'and 房态='空房'"
Data2.Refresh
'赋值给bh.text等
If .Fields("凭证号码") <> "" Then bh.Text = .Fields("凭证号码")
If .Fields("姓名") <> "" Then Texxmb.Text = .Fields("姓名")
If .Fields("证件名称") <> "" Then Combo1.Text = .Fields("证件名称")
If .Fields("证件号码") <> "" Then Texsfz.Text = .Fields("证件号码")
If .Fields("客房价格") <> "" Then Texjg.Text = .Fields("客房价格")
End With
End If
End If
DBCombo1.Enabled = True
Texbz.Enabled = True
End If
End Sub
Private Sub DBCOMBO2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DBCombo1.SetFocus '按回车键DBCombo1获得焦点
End Sub
Private Sub texbz_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Comok.SetFocus '按回车键comok获得焦点
End Sub
Private Sub comdj_Click() '登记
Frame2.Enabled = True: Frame3.Enabled = True: DBCombo2.Enabled = True
DBCombo1.Enabled = True: Texjg.Enabled = True: Comok.Enabled = True
Comcancel.Enabled = True: Comok.Enabled = True: Comdj.Enabled = False
DBCombo2.SetFocus 'DBCombo2获得焦点
751com.cn
Data2.RecordSource = "select * from kf where 房间号='" & DBCombo1.Text & "'and 房态='空房'"
Data2.Refresh
If Data2.Recordset.RecordCount > 0 Then
Dim mydb1 As Database
Dim myrs2 As Recordset
Set mydb1 = Workspaces(0).OpenDatabase(App.Path & "\KFGL.MDB")
'查询所有住宿登记信息
Data1.RecordSource = "select * from djb"
Data1.Refresh
Data1.Recordset.FindFirst "房间号 ='" & DBCombo2.Text & "'and 标志='1'"
bh = Data1.Recordset.Fields("凭证号码")
Data1.Recordset.Edit '编辑住宿登记信息
If DBCombo1.Text <> "" Then Data1.Recordset.Fields("房间号") = Val(DBCombo1.Text)
If Texbz.Text <> "" Then Data1.Recordset.Fields("备注") = Texbz.Text
Data1.Recordset.Fields("标志") = "1"
Data1.Recordset.Fields("摘要") = "由源房" & DBCombo2.Text & "调到目标房" & DBCombo1.Text
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>