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

📄 frminputdriearning.frm

📁 vb+sql 用于公交点钞结算和报表结合的相关软件
💻 FRM
📖 第 1 页 / 共 5 页
字号:
            Height          =   240
            Index           =   10
            Left            =   5610
            TabIndex        =   28
            Top             =   1620
            Width           =   720
         End
         Begin VB.Label Label1 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "点钞员工号:"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   13
            Left            =   5580
            TabIndex        =   27
            Top             =   330
            Width           =   1440
         End
         Begin VB.Label Label1 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "复核员工号:"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   14
            Left            =   5580
            TabIndex        =   26
            Top             =   1110
            Width           =   1440
         End
      End
   End
End
Attribute VB_Name = "frmInputEarning"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim nobusno As Boolean
Private Function NoToName(OpNo As String) As String
    Dim rs As New ADODB.Recordset
    If OpNo <> "" Then
        rs.Open "select opname,OP_NO from AMC_DCY_INFO where opno=" + Trim(OpNo), cnn, adOpenStatic, adLockOptimistic
        If rs.EOF Then
        Else
            NoToName = rs.Fields(0).Value
            txtDcOP_No = rs.Fields(1).Value
        End If
    End If
End Function

Private Function DrNoToName(OpNo As String) As String
    Dim rs As New ADODB.Recordset
    If OpNo <> "" Then
        rs.Open "select name from zz_bus_ic.dbo.Zy_Worker_INFO where op_no='" + Trim(OpNo) + "'", cnn, adOpenStatic, adLockOptimistic
        If rs.EOF Then
        Else
            DrNoToName = rs.Fields(0).Value
        End If
    End If
End Function

Private Sub cmbCompany_GotFocus()
    Dim rs As New ADODB.Recordset
    On Error Resume Next
    cmbCompany.ListIndex = -1
    rs.Open "select * from zz_bus_ic.dbo.ZY_line_bus_dept_view where line_no='" + txtLineNo + "'", cnn, adOpenStatic, adLockOptimistic
    If rs.EOF Then
        MsgBox "无此线路号,请检查重输!", vbExclamation, "提示."
        Exit Sub
    Else
        cmbCompany.Text = rs.Fields(1).Value
    End If

End Sub

Private Sub cmbCompany_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        txtDriverNo.SetFocus
    End If
End Sub

Private Sub cmbSxw_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        txtDcOPNo.SetFocus
    End If
End Sub

Private Sub cmdCancel_Click()
    txtBusNo = ""
    txtCheckName = ""
    txtCheckNo = ""
    txtDcName = ""
    txtDcOPNo = ""
    txtDriverName = ""
    txtDriverNo = ""
    txtLineNo = ""
    txtM001 = ""
    txtM002 = ""
    txtM005 = ""
    txtM01 = ""
    txtM02 = ""
    txtM05 = ""
    txtM1 = ""
    txtM2 = ""
    txtM5 = ""
    txtM10 = ""
    txtM20 = ""
    txtM50 = ""
    txtM100 = ""
    txtToTalMoney = 0
    txtTotalNum = 0
    txtToTalTicket = 0
    cmbCompany.ListIndex = -1
End Sub

Private Sub cmdDel_Click()
    
End Sub

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    Dim acmd As New Command
    Dim param As ADODB.Parameter
    Dim rs As New ADODB.Recordset
    If txtLineNo = 0 Or txtDcOPNo = 0 Or txtCheckNo = 0 Or txtLineNo = "" Or cmbCompany.Text = "" Or txtDriverName = "" Or txtDcName = "" Then 'Or txtToTalMoney = 0 Or txtTotalNum = 0 Then
        MsgBox "数据录入不完整,请检查重输!", vbExclamation, "提示..."
        Exit Sub
    End If
    On Error Resume Next
    With acmd
        .ActiveConnection = cnn
        .CommandText = "ZYSP_INSERT_CASH_INPUT"
        .CommandType = adCmdStoredProc
        .Parameters("@DRIVEROPNO") = Trim(txtDriverNo)
        .Parameters("@INPUT_DATE") = Trim(dtpDate)
        .Parameters("@BUS_NO") = Trim(txtBusNo)
        .Parameters("@LINE_NO") = Trim(txtLineNo)
        rs.Open "select dept_no from zz_bus_ic.dbo.zy_dept_info where name='" + Trim(cmbCompany.Text) + "'", cnn, adOpenStatic, adLockOptimistic
        If Not rs.EOF Then
            .Parameters("@DEPT_NO") = rs.Fields(0).Value
        Else
            MsgBox "数据录入不完整,请检查重输!", vbExclamation, "提示..."
            Exit Sub
        End If
        .Parameters("@COUNTBILLOPNO") = Trim(txtDcOP_No)
        .Parameters("@CHECKOPNO") = Trim(txtDcOP_No) 'Trim(txtCheckNo)
        .Parameters("@M100") = Trim(txtM100)
        .Parameters("@M50") = Trim(txtM50)
        .Parameters("@M20") = Trim(txtM20)
        .Parameters("@M10") = Trim(txtM10)
        .Parameters("@M5") = Trim(txtM5)
        .Parameters("@M2") = Trim(txtM2)
        .Parameters("@M1") = Trim(txtM1)
        .Parameters("@M05") = Trim(txtM05)
        .Parameters("@M02") = Trim(txtM02)
        .Parameters("@M01") = Trim(txtM01)
        .Parameters("@M005") = Trim(txtM005)
        .Parameters("@M002") = Trim(txtM002)
        .Parameters("@M001") = Trim(txtM001)
        .Parameters("@SXW") = cmbSxw.ListIndex
        .Parameters("@DAYTOTALSUM") = Trim(txtTotalNum)
        .Parameters("@DAYTOTALMONEY") = CDbl(Trim(txtToTalMoney))
        .Parameters("@DAYTOTALTICKET") = Trim(txtToTalTicket)
        .Execute '
        If Err.Number <> 0 Then
            MsgBox "数据输入失败! 此条记录已经录入,不能重复输入!", , "提示..."
            Debug.Print Err.Description
        Else
            MsgBox "数据成功!", , "提示..."
        End If
        'dtpDate.SetFocus
        cmdCancel_Click
        txtBusNo.SetFocus
    End With
End Sub


Private Sub dtpDate_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        txtBusNo.SetFocus
    End If
End Sub

Private Sub Form_Load()
    dtpDate = Format(DateAdd("d", -1, Now), "yyyyMMdd")
    Dim rs As New ADODB.Recordset
    Set rs = New ADODB.Recordset
    rs.Open "select * from zz_bus_ic.dbo.zy_dept_info where dept_no<100 and is_trans=1", cnn, adOpenStatic, adLockOptimistic
    i = 0
    Do While Not rs.EOF
        cmbCompany.AddItem rs.Fields(1).Value
        rs.MoveNext
    Loop
    txtCheckNo = cCheckOP
    txtCheckName = Trim(cCheckName)
    cmbSxw.ListIndex = 0
    cmbCompany.ListIndex = 0
End Sub

Private Sub Form_Resize()
'    If WindowState <> 2 Then
'        Width = 9800
'        Height = 6660
'    End If
End Sub

Private Sub txtBusNo_Change()
    If Not IsNumeric(txtBusNo) Then
        txtBusNo = 0
    End If
End Sub

Private Sub txtBusNo_GotFocus()
    txtBusNo.SelLength = Len(txtBusNo)
End Sub

Private Sub txtBusNo_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        txtLineNo.SetFocus
    End If
End Sub


Private Sub txtBusNo_LostFocus()
    
    Dim rs As New ADODB.Recordset
'    On Error Resume Next
    txtLineNo = ""
    cmbCompany.ListIndex = -1
    
    If Trim(txtBusNo) = "0" Then
        MsgBox "漏填车辆号,请确认!", vbExclamation, "提示..."
    End If
    rs.Open "select * from zz_bus_ic.dbo.ZY_line_bus_dept_view where bus_no='" + txtBusNo + "'", cnn, adOpenStatic, adLockOptimistic
    If rs.EOF Then
        MsgBox "无此车辆号,请检查重输!", vbExclamation, "提示..."
        nobusno = True
        txtLineNo.SetFocus
        
        Exit Sub
    Else
        txtLineNo = rs.Fields(3).Value
        cmbCompany = CStr(rs.Fields(1).Value)
        txtLineNo.SetFocus
    End If
End Sub

Private Sub txtCheckNo_Change()
    If Not IsNumeric(txtCheckNo) Then
        txtCheckNo = 0
    End If
End Sub

Private Sub txtCheckNo_GotFocus()
    txtCheckNo.SelLength = Len(txtCheckNo)
End Sub

Private Sub txtCheckNo_LostFocus()
    txtCheckName = NoToName(Trim(txtCheckNo))
    If txtCheckName = "" Then
        MsgBox "无此复核员工号,请检查重输!", vbExclamation, "提示..."
        Exit Sub
    End If
End Sub

Private Sub txtDcOPNo_Change()
    If Not IsNumeric(txtDcOPNo) Then
        txtDcOPNo = 0
    End If
End Sub

Private Sub txtDcOPNo_GotFocus()
    txtDcOPNo.SelLength = Len(txtDcOPNo)
End Sub

Private Sub txtDcOPNo_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        '=======================
        txtCheckNo.Text = txtDcOPNo.Text
        
        txtM100.SetFocus
    End If
End Sub

Private Sub txtDcOPNo_LostFocus()
    txtDcName = NoToName(Trim(txtDcOPNo))
    txtCheckName.Text = txtDcName.Text
    If txtDcName = "" Then
        MsgBox "无此点钞员工号,请检查重输!", vbExclamation, "提示..."
        Exit Sub
    End If
End Sub

Private Sub txtDriverNo_Change()
    If Not IsNumeric(txtDriverNo) Then
        txtDriverNo = 0
    End If
End Sub

Private Sub txtDriverNo_GotFocus()
    txtDriverNo.SelLength = Len(txtDriverNo)
End Sub

Private Sub txtDriverNo_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        cmbSxw.SetFocus
    End If
End Sub

Private Sub txtDriverNo_LostFocus()
    If txtDriverNo.Text = "" Then
        txtDriverNo = "0"
        txtDriverName = "补单"
    End If
    txtDriverName = DrNoToName(Trim(txtDriverNo))
    If txtDriverName = "" Then
        'MsgBox "无此司机工号,请检查重输!", vbExclamation, "提示..."
        txtDriverName = "补单"
        Exit Sub
    End If
End Sub

Private Sub txtLineNo_Change()
    If Not IsNumeric(txtLineNo) Then
        txtLineNo = 0
    End If
End Sub

Private Sub txtLineNo_GotFocus()
    txtLineNo.SelLength = Len(txtLineNo)
End Sub

Private Sub txtLineNo_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        cmbCompany.SetFocus
    End If
End Sub

Private Sub txtM100_Change()
    If Not IsNumeric(txtM100.Text) Then
        txtM100 = 0
    End If
End Sub

Private Sub txtM100_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        txtM50.SetFocus
    Else
        KeyAscii = clsDaivd.ValiText(KeyAscii, "0123456789", True)
    End If
    
End Sub

Private Sub txtM50_Change()
    If Not IsNumeric(txtM50.Text) Then
        txtM50 = 0
    End If
End Sub

Private Sub txtM50_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        txtM20.SetFocus
    Else
        KeyAscii = clsDaivd.ValiText(KeyAscii, "0123456789", True)
    End If
End Sub

⌨️ 快捷键说明

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