📄 cx_yddk.frm
字号:
Case 2 '今日预达
Set rec = PUB_data.OpenRecordset("select YDD_H,KR_MC,RZRQ,YDSJ,LDRQ,YDRQ,GJDM,DF_JS,GZ_JS,RS,DFY_DM,KHDM,LOCK_NO from YD_YDDK WHERE CSTR(RZRQ)='" & Date + 1 & "'", 4)
If Not rec.BOF Then
rec.MoveLast
End If
Call pub_memo.Flex_full(flex1, t_bt, rec, t_fields, 10, Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
rec_no.Caption = "当前记录数:" + CStr(flex1.Rows - 1)
Call first
m_ydd_h.Text = ""
m_rzrq.Text = " - - "
m_ldrq.Text = " - - "
m_ydrq.Text = " - - "
m_kr_mc.Text = ""
m_gjdm.Text = ""
m_dfy_dm.Text = ""
Case 3 '明日预达
Set rec = PUB_data.OpenRecordset("select YDD_H,KR_MC,RZRQ,YDSJ,LDRQ,YDRQ,GJDM,DF_JS,GZ_JS,RS,DFY_DM,KHDM,LOCK_NO from YD_YDDK WHERE CSTR(RZRQ)='" & Date + 2 & "'", 4)
If Not rec.BOF Then
rec.MoveLast
End If
Call pub_memo.Flex_full(flex1, t_bt, rec, t_fields, 10, Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
rec_no.Caption = "当前记录数:" + CStr(flex1.Rows - 1)
Call first
m_ydd_h.Text = ""
m_rzrq.Text = " - - "
m_ldrq.Text = " - - "
m_ydrq.Text = " - - "
m_kr_mc.Text = ""
m_gjdm.Text = ""
m_dfy_dm.Text = ""
Case 4 '刷新
Call flex1_ref
Case 5 '打印
Call PRINT_1
End Select
End Sub
Private Sub Cmd3_Click()
Unload Me
yx_main.Show (1)
End Sub
Private Sub flex1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Cmd2(0).SetFocus
End If
End Sub
Sub MAIN(t_gnmc As String)
Label1.Caption = t_gnmc
End Sub
Private Sub first()
Frame6.Enabled = False
If flex1.Rows = 1 Then
Cmd2(0).Enabled = False
Cmd2(1).Enabled = False
Cmd2(2).Enabled = False
Cmd2(3).Enabled = False
Cmd2(4).Enabled = False
End If
If flex1.Enabled = False Then
flex1.Enabled = True
flex1.SetFocus
End If
End Sub
Public Sub flex1_ref()
If Not T_TJ = "" Then
Set rec = PUB_data.OpenRecordset("select YDD_H,KR_MC,RZRQ,YDSJ,LDRQ,YDRQ,GJDM,DF_JS,GZ_JS,RS,DFY_DM,KHDM,LOCK_NO from YD_YDDK WHERE " & T_TJ, 4)
If Not rec.BOF Then
rec.MoveLast
Call pub_memo.Flex_full(flex1, t_bt, rec, t_fields, 10, Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
End If
Else
Set rec = PUB_data.OpenRecordset("select YDD_H,KR_MC,RZRQ,YDSJ,LDRQ,YDRQ,GJDM,DF_JS,GZ_JS,RS,DFY_DM,KHDM,LOCK_NO from YD_YDDK", 4)
If Not rec.BOF Then
rec.MoveLast
Call pub_memo.Flex_full(flex1, t_bt, rec, t_fields, 10, Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
End If
End If
rec_no.Caption = "当前记录数:" + CStr(flex1.Rows - 1)
End Sub
Private Sub m_dfy_dm_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Or KeyCode = vbKeyDown Then
If Trim(m_ydd_h.Text) = "" Then
T_TJ = ""
Else
T_TJ = "YDD_H='" & UCase(Trim(m_ydd_h.Text)) & "'"
End If
If Not m_rzrq.Text = " - - " Then
If T_TJ = "" Then
T_TJ = T_TJ & "CSTR(RZRQ)='" & m_rzrq.Text & "'"
Else
T_TJ = T_TJ & "AND CSTR(RZRQ)='" & m_rzrq.Text & "'"
End If
End If
If Not m_ldrq.Text = " - - " Then
If T_TJ = "" Then
T_TJ = T_TJ & "CSTR(LDRQ)='" & m_ldrq.Text & "'"
Else
T_TJ = T_TJ & "AND CSTR(LDRQ)='" & m_ldrq.Text & "'"
End If
End If
If Not Trim(m_kr_mc.Text) = "" Then
If T_TJ = "" Then
T_TJ = T_TJ & " TRIM(KR_MC)='" & UCase(Trim(m_kr_mc.Text)) & "'"
Else
T_TJ = T_TJ & "AND TRIM(KR_MC)='" & UCase(Trim(m_kr_mc.Text)) & "'"
End If
End If
If Not m_ydrq.Text = " - - " Then
If T_TJ = "" Then
T_TJ = T_TJ & " CSTR(YDRQ)='" & m_ydrq.Text & "'"
Else
T_TJ = T_TJ & "AND CSTR(YDRQ)='" & m_ydrq.Text & "'"
End If
End If
If Not Trim(m_gjdm.Text) = "" Then
If T_TJ = "" Then
T_TJ = T_TJ & " TRIM(GJDM)='" & UCase(Trim(m_gjdm.Text)) & "'"
Else
T_TJ = T_TJ & "AND TRIM(GJDM)='" & UCase(Trim(m_gjdm.Text)) & "'"
End If
End If
If Not Trim(m_dfy_dm.Text) = "" Then
If T_TJ = "" Then
T_TJ = T_TJ & "TRIM(DFY_DM)='" & UCase(Trim(m_dfy_dm.Text)) & "'"
Else
T_TJ = T_TJ & "AND TRIM(DFY_DM)='" & UCase(Trim(m_dfy_dm.Text)) & "'"
End If
End If
Text1.Text = T_TJ
If Not T_TJ = "" Then
Set rec = PUB_data.OpenRecordset("select YDD_H,KR_MC,RZRQ,YDSJ,LDRQ,YDRQ,GJDM,DF_JS,GZ_JS,RS,DFY_DM,KHDM,LOCK_NO from YD_YDDK WHERE " & T_TJ, 4)
If Not rec.BOF Then
rec.MoveLast
Dim n As Integer
n = rec.RecordCount
Call pub_memo.Flex_full(flex1, t_bt, rec, t_fields, 10, Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
End If
rec_no.Caption = "当前记录数:" + CStr(flex1.Rows - 1)
Call first
Else
Set rec = PUB_data.OpenRecordset("select YDD_H,KR_MC,RZRQ,YDSJ,LDRQ,YDRQ,GJDM,DF_JS,GZ_JS,RS,DFY_DM,KHDM,LOCK_NO from YD_YDDK", 4)
If Not rec.BOF Then
rec.MoveLast
Call pub_memo.Flex_full(flex1, t_bt, rec, t_fields, 10, Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
End If
rec_no.Caption = "当前记录数:" + CStr(flex1.Rows - 1)
Call first
End If
End If
End Sub
Private Sub m_gjdm_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Or KeyCode = vbKeyDown Then
m_dfy_dm.SetFocus
m_dfy_dm.SelStart = 0
m_dfy_dm.SelLength = Len(Trim(m_dfy_dm.Text))
End If
End Sub
Private Sub m_kr_mc_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Or KeyCode = vbKeyDown Then
m_ydrq.SetFocus
m_ydrq.SelStart = 0
m_ydrq.SelLength = Len(m_ydrq.Text)
End If
End Sub
Private Sub m_ldrq_Change()
frm_msg.Caption = ""
End Sub
Private Sub m_ldrq_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call m_ldrq_LostFocus
End If
End Sub
Private Sub m_ldrq_LostFocus()
If Not m_ldrq.Text = " - - " Then
t_rq = date_cl(m_ldrq.Text)
If Not t_rq = "F" Then
m_ldrq = t_rq
End If
If IsDate(m_ldrq.Text) Then
m_kr_mc.SetFocus
m_kr_mc.SelStart = 0
m_kr_mc.SelLength = Len(Trim(m_kr_mc.Text))
Else
frm_msg.Caption = "无效预离日期!"
m_ldrq.SelStart = 0
m_ldrq.SelLength = Len(m_ldrq.Text)
End If
Else
m_kr_mc.SetFocus
m_kr_mc.SelStart = 0
m_kr_mc.SelLength = Len(Trim(m_kr_mc.Text))
End If
End Sub
Private Sub m_rzrq_Change()
frm_msg.Caption = ""
End Sub
Private Sub m_rzrq_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call m_rzrq_LostFocus
End If
End Sub
Private Sub m_rzrq_LostFocus()
If Not m_rzrq.Text = " - - " Then
t_rq = date_cl(m_rzrq.Text)
If Not t_rq = "F" Then
m_rzrq = t_rq
End If
If IsDate(m_rzrq.Text) Then
m_ldrq.SetFocus
m_ldrq.SelStart = 0
m_ldrq.SelLength = Len(m_ldrq.Text)
Else
frm_msg.Caption = "无效预达日期!"
m_rzrq.SelStart = 0
m_rzrq.SelLength = Len(m_rzrq.Text)
End If
Else
m_ldrq.SetFocus
m_ldrq.SelStart = 0
m_ldrq.SelLength = Len(m_ldrq.Text)
End If
End Sub
Private Sub m_ydd_h_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
m_rzrq.SetFocus
m_rzrq.SelStart = 0
m_rzrq.SelLength = Len(m_rzrq.Text)
End If
End Sub
Private Sub m_ydrq_Change()
frm_msg.Caption = ""
End Sub
Private Sub m_ydrq_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call m_ydrq_LostFocus
End If
End Sub
Private Sub m_ydrq_LostFocus()
If Not m_ydrq.Text = " - - " Then
t_rq = date_cl(m_ydrq.Text)
If Not t_rq = "F" Then
m_ydrq = t_rq
End If
If IsDate(m_ydrq.Text) Then
m_gjdm.SetFocus
m_gjdm.SelStart = 0
m_gjdm.SelLength = Len(m_gjdm.Text)
Else
frm_msg.Caption = "无效预订日期!"
m_ydrq.SelStart = 0
m_ydrq.SelLength = Len(m_ydrq.Text)
End If
Else
m_gjdm.SetFocus
m_gjdm.SelStart = 0
m_gjdm.SelLength = Len(m_gjdm.Text)
End If
End Sub
Private Sub PRINT_1()
If Not T_TJ = "" Then
Set rec = PUB_data.OpenRecordset("select YDD_H,KR_MC,RZRQ,YDSJ,LDRQ,DF_JS,GZ_JS,RS,DFY_DM from YD_YDDK WHERE " & T_TJ, 4)
If Not rec.BOF Then
rec.MoveLast
End If
Else
Set rec = PUB_data.OpenRecordset("select YDD_H,KR_MC,RZRQ,YDSJ,LDRQ,DF_JS,GZ_JS,RS,DFY_DM from YD_YDDK", 4)
If Not rec.BOF Then
rec.MoveLast
End If
End If
Call print_tabler(rec, "客房预订清单", Array("预订单号", "客人名称", "预达日期", " 预达时间", "预离日期", "预订房数", "管制房数", "人数", "订房员"), Array(18, 25, 15, 15, 12, 8, 10, 6, 8), 40, Array(11, 11, 11, 11, 11, 21, 21, 21, 21))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -