⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scgl_clk.frm

📁 一个简单的酒店管理系统 用VB.net+SQL2000实现
💻 FRM
📖 第 1 页 / 共 5 页
字号:
    Case vbKeyUp
        m_dz.SetFocus
    Case vbKeyReturn
        m_kf_zkl.SetFocus
    End Select

End Sub

Private Sub m_kf_zkl_KeyDown(KeyCode As MSForms.ReturnInteger, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
'        m_kf_fz.SetFocus
    Case vbKeyReturn
        cm_tsfw.SetFocus
    End Select

End Sub

Private Sub m_kr_m_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        m_kr_x.SetFocus
    Case vbKeyDown, vbKeyReturn
        m_yw_x.SetFocus
    End Select

End Sub

Private Sub m_kr_qz_yxq_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        cm_qzmc.SetFocus
    Case vbKeyDown, vbKeyReturn
        m_ldcs.SetFocus
    End Select

End Sub

Private Sub m_kr_sr_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        If op_xb(0).Value Then
            op_xb(0).SetFocus
        ElseIf op_xb(1).Value Then
            op_xb(2).SetFocus
        Else
            op_xb(2).SetFocus
        End If
    Case vbKeyDown, vbKeyReturn
        m_dfy_dm.SetFocus
    End Select

End Sub

Private Sub m_kr_x_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        M_XH.SetFocus
    Case vbKeyDown, vbKeyReturn
        m_kr_m.SetFocus
    End Select

End Sub
Private Sub m_kr_zjhm_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        cm_zjmc.SetFocus
    Case vbKeyDown, vbKeyReturn
        m_qzdm.SetFocus
    End Select

End Sub


Private Sub m_ldcs_KeyDown(KeyCode As MSForms.ReturnInteger, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
'        m_kr_qz_yxq.SetFocus
    Case vbKeyReturn
        m_dz.SetFocus
    End Select

End Sub

Private Sub m_qzdm_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        m_kr_zjhm.SetFocus
    Case vbKeyDown, vbKeyReturn
        cm_qzmc.SetFocus
    End Select

End Sub

Private Sub m_xh_KeyDown(KeyCode As MSForms.ReturnInteger, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        M_XH.SetFocus
        'cmd_ok(1).SetFocus
    Case vbKeyReturn  ', vbKeyDown
        m_kr_x.SetFocus
    End Select
End Sub
Private Sub m_xh_LostFocus()
    Dim ckqd_rec As Recordset

    If Trim(M_XH.Text) = "" Then
        M_XH.Text = 0
    End If
    
    Set ckqd_rec = PUB_data.OpenRecordset("SELECT * FROM DT_CKQD WHERE XH=" & M_XH.Text, 4, 0, 2)
    If Not ckqd_rec.BOF Then
        ckqd_rec.MoveLast
        tPkjTextSet ckqd_rec, 1
    Else
        frm_msg.Visible = True
        frm_msg.Caption = "没有满足条件的记录"
        M_XH.SetFocus
    End If
    ckqd_rec.Close
    
    Select Case t_funcNo
    Case "1"    '修改
'        m_kr_x.SetFocus
    Case "2"    '删除
        cmd_ok(0).SetFocus
    End Select
End Sub

Private Sub m_yw_m_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        m_yw_x.SetFocus
    Case vbKeyDown, vbKeyReturn
        If op_xb(0).Value Then
            op_xb(0).SetFocus
        ElseIf op_xb(1).Value Then
            op_xb(1).SetFocus
        Else
            op_xb(2).SetFocus
        End If
    End Select

End Sub

Private Sub m_yw_x_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        m_kr_m.SetFocus
    Case vbKeyDown, vbKeyReturn
        m_yw_m.SetFocus
    End Select

End Sub

Private Sub m_gjdm_LostFocus()
    m_gjdm.Text = UCase(Trim(m_gjdm.Text))
    Call PUB_DMLostFocus(m_gjdm, cm_gjmc, frm_msg, "不适当的国籍代码")

End Sub
Private Sub cm_gjmc_LostFocus()
    Call PUB_MCLostFocus(m_gjdm, cm_gjmc, frm_msg, "不适当的国籍信息")
End Sub
Private Sub cm_gjmc_Click()
    m_gjdm.Text = cm_gjmc.List(cm_gjmc.ListIndex, 0)
    cm_gjmc.Text = cm_gjmc.List(cm_gjmc.ListIndex, 1)
End Sub

Private Sub m_zjdm_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        cm_gjmc.SetFocus
    Case vbKeyDown, vbKeyReturn
        cm_zjmc.SetFocus
    End Select

End Sub
Private Sub m_zjdm_LostFocus()
    Call PUB_DMLostFocus(m_zjdm, cm_zjmc, frm_msg, "不适当的证件代码")
End Sub

Private Sub cm_zjmc_LostFocus()
    Call PUB_MCLostFocus(m_zjdm, cm_zjmc, frm_msg, "不适当的证件信息")
End Sub

Private Sub cm_zjmc_Click()
    m_zjdm.Text = cm_zjmc.List(cm_zjmc.ListIndex, 0)
    cm_zjmc.Text = cm_zjmc.List(cm_zjmc.ListIndex, 1)
End Sub
Private Sub m_qzdm_LostFocus()
    m_qzdm.Text = UCase(Trim(m_qzdm.Text))
    Call PUB_DMLostFocus(m_qzdm, cm_qzmc, frm_msg, "不适当的签证代码")

End Sub

Private Sub cm_qzmc_LostFocus()
    Call PUB_MCLostFocus(m_qzdm, cm_qzmc, frm_msg, "不适当的签证信息")
End Sub

Private Sub cm_qzmc_Click()
    m_qzdm.Text = cm_qzmc.List(cm_qzmc.ListIndex, 0)
    cm_qzmc.Text = cm_qzmc.List(cm_qzmc.ListIndex, 1)
End Sub

Private Sub Form_Load()
    frm_msg.Visible = False
    frm_msg.Caption = ""

    Me.KeyPreview = True
    
    fm_cx.Enabled = False
    lb_sx_zwxm.Enabled = False
    lb_sx_wwxm.Enabled = False
    lb_sx_kr_sr.Enabled = False
    lb_sx_gj.Enabled = False
    
    tx_kr_x.Enabled = False
    tx_kr_m.Enabled = False
    tx_yw_x.Enabled = False
    tx_yw_m.Enabled = False
    tx_kr_sr.Enabled = False
    tx_gjdm.Enabled = False
    tx_gjmc.Enabled = False
    
    tx_kr_x.Text = ""
    tx_kr_m.Text = ""
    tx_yw_x.Text = ""
    tx_yw_m.Text = ""
    tx_kr_sr.Text = "____-__-__"
    tx_gjdm.Text = ""
    tx_gjmc.Text = ""
    
    Call PUB_GetCMSG(PUB_data, "YD_TSFW", "TSFW", cm_tsfw)
    
    Call PUB_GetCMDB(PUB_data, cm_gjmc, "DT_KRGJK", "GJDM", "GJMC")
    Call PUB_GetCMDB(PUB_data, cm_zjmc, "DT_ZJZL", "ZJDM", "ZJMC")
    Call PUB_GetCMDB(PUB_data, cm_qzmc, "DT_QZLX", "QZDM", "QZMC")
    
    Set flex_rec = PUB_data.OpenRecordset("select XH,KR_X,KR_M,YW_X,YW_M,KR_XBMC,GJMC,ZJMC,KF_ZKL,KF_FZ,LDCS FROM DT_CKQD ORDER BY XH,KR_X,KR_M,YW_X,YW_M", 4, 0, 2)
    If Not flex_rec.BOF Then
        flex_rec.MoveLast
    End If

    t_fields = Array("XH", "KR_X", "KR_M", "YW_X", "YW_M", "KR_XBMC", "GJMC", "ZJMC", "KF_ZKL", "KF_FZ", "LDCS")  '设置显示字段
    t_fdxs = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)  '设置显示字段
    t_bt = ">序号  |<客  人  姓  |<客  人  名  |<英  文  姓   |<英  文  名   |^性别|<国  籍        |^证件名称            |>折扣率|>房  租      |>来店次数"   '设置显示表头格式
    t_fdcounts = 11
    
    Call flex_refresh
    
    tPkjTextSet flex_rec, 0  '把当前字段清空
    
    tPkjEnabledFT "", False

End Sub

Private Sub gd1_GotFocus()
    Dim ckqd_rec As Recordset
    
    If gd1.Rows - 1 <> 0 Then
        Set ckqd_rec = PUB_data.OpenRecordset("SELECT * FROM DT_CKQD WHERE XH=" & IIf(gd1.TextArray(gd1.Row * t_fdcounts) = "" Or (Not IsNumeric(gd1.TextArray(gd1.Row * t_fdcounts))), 0, gd1.TextArray(gd1.Row * t_fdcounts)), 4, 0, 2)
        If Not ckqd_rec.BOF Then
            ckqd_rec.MoveLast
            tPkjTextSet ckqd_rec, 1     '按记录集给字段赋值
        Else
            tPkjTextSet ckqd_rec, 0    '把字段清空
        End If
        ckqd_rec.Close
    Else
        tPkjTextSet ckqd_rec, 0   '把字段清空
    End If
End Sub

Private Sub gd1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        cmd_func(0).SetFocus
    End If
End Sub

Private Sub gd1_RowColChange()
    Call gd1_GotFocus
End Sub

Private Sub op_xb_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        m_yw_m.SetFocus
    Case vbKeyReturn
        m_kr_sr.SetFocus
    End Select

End Sub

Private Sub tx_gjdm_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        tx_kr_sr.SetFocus
    Case vbKeyDown, vbKeyReturn
        tx_gjmc.SetFocus
    End Select

End Sub

Private Sub tx_gjdm_LostFocus()
    tx_gjdm.Text = UCase(Trim(tx_gjdm.Text))
    Call PUB_DMLostFocus(tx_gjdm, tx_gjmc, frm_msg, "不适当的国籍代码")

End Sub

Private Sub tx_gjmc_KeyDown(KeyCode As MSForms.ReturnInteger, Shift As Integer)
    Select Case KeyCode
    Case vbKeyUp
        tx_gjdm.SetFocus
    End Select

End Sub

Private Sub tx_gjmc_LostFocus()
    Dim temp_ft As Boolean
    Dim temp_tj As String
    Dim temp_and As Boolean
    Dim temp_len As Integer
    
    temp_ft = PUB_MCLostFocus(tx_gjdm, tx_gjmc, frm_msg, "不适当的国籍信息")
    If temp_ft Then  '筛选
        
        '客人生日合法性校验
        If PUB_RQJY(m_kr_sr, frm_msg) Then
        Else
            Exit Sub
        End If
        
        fm_cx.Enabled = False
        lb_sx_zwxm.Enabled = False
        lb_sx_wwxm.Enabled = False
        lb_sx_kr_sr.Enabled = False
        lb_sx_gj.Enabled = False
        
        tx_kr_x.Enabled = False
        tx_kr_m.Enabled = False
        tx_yw_x.Enabled = False
        tx_yw_m.Enabled = False
        tx_kr_sr.Enabled = False
        tx_gjdm.Enabled = False
        tx_gjmc.Enabled = False
        
        temp_tj = "SELECT * FROM DT_CKQD "
        If Trim(tx_kr_x.Text <> "") Or Trim(tx_kr_m.Text <> "") Or Trim(tx_yw_x.Text <> "") Or Trim(tx_yw_m.Text <> "") Or Trim(tx_kr_sr.Text <> "____-__-__") Or (Trim(tx_gjdm.Text <> "") And Trim(tx_gjdm.Text <> "*")) Or (Trim(tx_gjmc.Text <> "") And Trim(tx_gjmc.Text <> "*")) Then
            temp_and = False
            If Trim(tx_kr_x.Text <> "") Then
                temp_and = True
                temp_len = Len(Trim(tx_kr_x.Text))
                temp_tj = temp_tj & " WHERE LEFT(TRIM(KR_X)," & temp_len & ")='" & Trim(tx_kr_x.Text) & "' "
            End If
            If Trim(tx_kr_m.Text <> "") Then
                temp_and = True
                temp_len = Len(Trim(tx_kr_m.Text))
                temp_tj = temp_tj & IIf(temp_and, " AND ", "") & " LEFT(TRIM(KR_M)," & temp_len & ")='" & Trim(tx_kr_m.Text) & "' "
            End If
            If Trim(tx_yw_x.Text <> "") Then
                temp_and = True
                temp_len = Len(Trim(tx_yw_x.Text))
                temp_tj = temp_tj & IIf(temp_and, " AND ", "") & " LEFT(TRIM(YW_X)," & temp_len & ")='" & Trim(tx_yw_x.Text) & "' "
            End If
            If Trim(tx_yw_m.Text <> "") Then
                temp_and = True
                temp_len = Len(Trim(tx_yw_m.Text))
                temp_tj = temp_tj & IIf(temp_and, " AND ", "") & " LEFT(TRIM(YW_M)," & temp_len & ")='" & Trim(tx_yw_m.Text) & "' "
            End If
            If Trim(tx_kr_sr.Text <> "____-__-__") Then
                temp_and = True
                temp_tj = temp_tj & IIf(temp_and, " AND ", "") & " KR_SR=#" & tx_kr_sr.Text & "# "
            End If
            If Trim(tx_gjdm.Text <> "") And Trim(tx_gjdm.Text <> "*") Then
                temp_and = True
                temp_tj = temp_tj & IIf(temp_and, " AND ", "") & " TRIM(GJDM)='" & Trim(tx_gjdm.Text) & "'  "
            End If
            If Trim(tx_gjmc.Text <> "") And Trim(tx_gjmc.Text <> "*") Then
                temp_and = True
                temp_tj = temp_tj & IIf(temp_and, " AND ", "") & " TRIM(GJMC)='" & Trim(tx_gjmc.Text) & "'  "
            End If
            
        End If
        
        Set flex_rec = PUB_data.OpenRecordset(temp_tj,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -