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

📄 frminput.frm

📁 环保局排污费通知单打印.rar
💻 FRM
📖 第 1 页 / 共 3 页
字号:
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False



Private Sub cbojsr1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub cbojsr2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub



Private Sub cmdPrint_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
Unload frmPrint
End Sub

Private Sub txtDWMC_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub


Private Sub txtFQje_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub


Private Sub txtGTje_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub txtKDR_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub txtKDY_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub txtZSE_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub


Private Sub txtWSCBje_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub txtWSje_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub txtWXje_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub txtZSje_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub txtZSY_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    SendKeys ("{TAB}")
End If
End Sub

Private Sub Form_Load()    '启动窗体时读入系统日期
txtKDN.Text = Year(Date)
txtKDY.Text = Month(Date)
txtKDR.Text = Day(Date)

txtZSN.Text = Year(Date)

End Sub

Private Sub cmdNewClear_Click()
txtDWMC.Text = ""
txtZSY.Text = ""
txtWSje.Text = ""
txtWSCBje.Text = ""
txtFQje.Text = ""
txtZSje.Text = ""
txtGTje.Text = ""
txtWXje.Text = ""

txtDWMC.SetFocus
End Sub




'--------------------------------------------------
'                    打印
'--------------------------------------------------
Private Sub cmdPrint_Click()
Dim intJE_num As Integer  '金额字符数

Dim sinJe_Hj As Single
Dim strJe_Hj As String
'排污费合计金额
Dim i, j, k
Dim sinJe_Chr As String
Dim intStar As Integer

Dim sinJe(6) As Single   '记录各个输入金额到数组
'Dim intJe(6) As Integer
Dim strJe As String

Unload frmPrint

If txtDWMC.Text = "" Then
    MsgBox "请输入单位名称", vbOKOnly, "Hello"
    txtDWMC.SetFocus
ElseIf txtZSY.Text = "" Then
    MsgBox "请输入征收月分", vbOKOnly, "Hello"
    txtZSY.SetFocus
'ElseIf txtZSE.Text = "" Then
'    MsgBox "请输入征收金额", vbOKOnly, "Hello"
'    txtZSE.SetFocus
ElseIf cboJSR1.Text = "" Then
    MsgBox "请输入经手人", vbOKOnly, "Hello"
    cboJSR1.SetFocus
ElseIf cboJSR2.Text = "" Then
    MsgBox "请输入经手人", vbOKOnly, "Hello"
    cboJSR2.SetFocus
Else
    With frmPrint
        .lblDWMC = txtDWMC.Text
        .lblZSN = txtZSN.Text
        .lblZSY = txtZSY.Text
        .lblJSR1 = cboJSR1.Text
        .lblJSR2 = cboJSR2.Text
        .lblKDN = txtKDN.Text
        .lblKDY = txtKDY.Text
        .lblKDR = txtKDR.Text
    
    If txtWSje.Text <> "" Then sinJe(0) = txtWSje.Text
    If txtWSCBje.Text <> "" Then sinJe(1) = txtWSCBje.Text
    If txtFQje.Text <> "" Then sinJe(2) = txtFQje.Text
    If txtZSje.Text <> "" Then sinJe(3) = txtZSje.Text
    If txtGTje.Text <> "" Then sinJe(4) = txtGTje.Text
    If txtWXje.Text <> "" Then sinJe(5) = txtWXje.Text
    
    
    '将金额按字符分开,赋值给打印标签
    For k = 0 To 5
        If sinJe(k) <> 0 Then
            sinJe_Hj = sinJe_Hj + sinJe(k)
            strJe = Str(sinJe(k))
            intJE_num = Len(strJe)
                        
            '处理有小数情况
            intStar = InStr(1, strJe, ".")
            If intStar = 0 Then
                strJe = strJe & "00"
            ElseIf intJE_num - intStar = 2 Then  '小数点后是否还有两位数
                strJe = funDelStr(strJe, intStar, 1)
            ElseIf intJE_num - intStar = 1 Then  '小数点后是否还有1位数
                strJe = funDelStr(strJe, intStar, 1) & "0"
            End If
                                   
            intJE_num = Len(strJe)  'strJe位数已经改变
            For i = 0 To intJE_num - 1
                sinJe_Chr = Mid(strJe, intJE_num - i, 1)
                .lblJE(i + k * 10).Caption = sinJe_Chr
            Next
            'j = j + 10
        End If
    Next
        
    '合计数额
    If sinJe_Hj <> 0 Then
        strJe_Hj = Str(sinJe_Hj)
        intJE_num = Len(strJe_Hj)
        
        intStar = InStr(1, strJe_Hj, ".")
        If intStar = 0 Then
            strJe_Hj = strJe_Hj & "00"
        ElseIf intJE_num - intStar = 2 Then  '小数点后是否还有两位数
            strJe_Hj = funDelStr(strJe_Hj, intStar, 1)
        ElseIf intJE_num - intStar = 1 Then  '小数点后是否还有1位数
            strJe_Hj = funDelStr(strJe_Hj, intStar, 1) & "0"
        End If
        
        intJE_num = Len(strJe_Hj)
        For i = 0 To intJE_num - 1
            sinJe_Chr = Mid(strJe_Hj, intJE_num - i, 1)
            .lblJE(i + 60).Caption = sinJe_Chr
        Next
    End If
        
        'If txtWSCBje.Text <> "" Then   '废水超标
        '   strJe_Hj = strJe_Hj + CLng(txtWSCBje.Text)
        '    intJE_num = Len(txtWSCBje.Text)
        '    For i = 0 To intJE_num - 1
        '        sinJe_Chr = Mid(txtWSCBje.Text, intJE_num - i, 1)
        '        .lblJE(i + 10).Caption = sinJe_Chr
        '    Next
        'End If
        'If txtFQje.Text <> "" Then    '废气
        '    strJe_Hj = strJe_Hj + CLng(txtFQje.Text)
        '    intJE_num = Len(txtFQje.Text)
        '    For i = 0 To intJE_num - 1
        '        sinJe_Chr = Mid(txtFQje.Text, intJE_num - i, 1)
        '        .lblJE(i + 20).Caption = sinJe_Chr
        '    Next
        'End If
        'If txtZSje.Text <> "" Then    '噪声
        '    strJe_Hj = strJe_Hj + CLng(txtZSje.Text)
        '    intJE_num = Len(txtZSje.Text)
        '    For i = 0 To intJE_num - 1
        '        sinJe_Chr = Mid(txtZSje.Text, intJE_num - i, 1)
        '        .lblJE(i + 30).Caption = sinJe_Chr
        '    Next
        'End If
        'If txtGTje.Text <> "" Then
        '    strJe_Hj = strJe_Hj + CLng(txtGTje.Text)
        '    intJE_num = Len(txtGTje.Text)
        '    For i = 0 To intJE_num - 1
        '        sinJe_Chr = Mid(txtGTje.Text, intJE_num - i, 1)
        '        .lblJE(i + 40).Caption = sinJe_Chr
        '    Next
        'End If
        'If txtWXje.Text <> "" Then
        '    strJe_Hj = strJe_Hj + CLng(txtWXje.Text)
        '    intJE_num = Len(txtWXje.Text)
        '    For i = 0 To intJE_num - 1
        '        sinJe_Chr = Mid(txtWXje.Text, intJE_num - i, 1)
        '        .lblJE(i + 50).Caption = sinJe_Chr
        '    Next
        'End If
        
                    
        .lblJSR1 = cboJSR1.Text
        .lblJSR2 = cboJSR2.Text
        
        .lblKDN = txtKDN.Text
        .lblKDY = txtKDY.Text
        .lblKDR = txtKDR.Text
        
    End With
        
    'Printer.PaperSize = vbPRPSA4
    frmPrint.PrintForm

    
End If

cmdNewClear.SetFocus

End Sub




Private Sub chkFQ_Click()
If chkFQ.Value = 1 Then
    With txtFQje
        .Enabled = True
        .TabStop = True
    End With
ElseIf chkFQ.Value = 0 Then
    With txtFQje
        .Enabled = False
        .Text = ""
        .TabStop = False
    End With
End If
End Sub

Private Sub chkGT_Click()
If chkGT.Value = 1 Then
    With txtGTje
        .Enabled = True
        .TabStop = True
    End With
ElseIf chkGT.Value = 0 Then
    With txtGTje
        .Enabled = False
        .Text = ""
        .TabStop = False
    End With
End If
End Sub

Private Sub chkWS_Click()
If chkWS.Value = 1 Then
    With txtWSje
        .Enabled = True
        .TabStop = True
    End With
ElseIf chkWS.Value = 0 Then
    With txtWSje
        .Enabled = False
        .Text = ""
        .TabStop = False
    End With
End If
End Sub

Private Sub chkWSCB_Click()
If chkWSCB.Value = 1 Then
    With txtWSCBje
        .Enabled = True
        .TabStop = True
    End With
ElseIf chkWSCB.Value = 0 Then
    With txtWSCBje
        .Enabled = False
        .Text = ""
        .TabStop = False
    End With
End If
End Sub

Private Sub chkWX_Click()
If chkWX.Value = 1 Then
    With txtWXje
        .Enabled = True
        .TabStop = True
    End With
ElseIf chkWX.Value = 0 Then
    With txtWXje
        .Enabled = False
        .Text = ""
        .TabStop = False
    End With
End If
End Sub

Private Sub chkZS_Click()
If chkZS.Value = 1 Then
    With txtZSje
        .Enabled = True
        .TabStop = True
    End With
ElseIf chkZS.Value = 0 Then
    With txtZSje
        .Enabled = False
        .Text = ""
        .TabStop = False
    End With
End If
End Sub







⌨️ 快捷键说明

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