VB电表管理信息系统 第11页
Me.BackColor = vbWhite
txtPrint.BackColor = vbWhite
Me.PrintForm
Me.BackColor = LongColor
Me.CmdPrint.Visible = True
Exit Sub
l: MsgBox Err.Description
End Sub
Private Sub Command1_Click()
Dim rstFeeEnd As New ADODB.Recordset
Dim cmdExe As New ADODB.Command
Dim reMoney As String
Dim sqlString As String
If Trim(txtFee) = "" Or Trim(txtM) = "" Then
MsgBox " 请先输入数据! ", vbInformation
Exit Sub
End If
reMoney = ConvertMe(Trim(txtFee))
Dim Change As String
Change = Val(txtM) - Val(txtFee)
If Change < 0 Then
If MsgBox(" 实收电费比应收现金大,您确定要这样收取? ", vbYesNo + vbInformation) = vbNo Then
Exit Sub
End If
End If
Me.txtHoldernum = MDIme.txtUserName(0)
Me.holderName = MDIme.dcvalue.Text
Me.lblEAmount = MDIme.txtUserName(1) & "度"
Me.endA = MDIme.txtUserName(2) & "度"
Me.lblHandInMoney = "¥" & Format(txtFee, "####0.00")
Me.lblSum = "¥" & Format(txtM.Text, "####0.00")
Me.lblfinaldate = Date
If Change >= 0 Then
Me.lblMoneyOfCard = "¥" & Format(Change, "####0.00")
Else
Me.lblMoneyOfCard = 0
End If
rstFeeEnd.Open "select * from panelinfo where holderid='" & MDIme.txtUserName(0) & "' and delflag<>true ", gCnn, adOpenStatic, adLockBatchOptimistic
Dim rusrType As New ADODB.Recordset
If rstFeeEnd.RecordCount <> 0 Then
rusrType.Open "select * from 用户类型 where AtypeID=" & rstFeeEnd.Fields!AtypeID, gCnn, adOpenStatic, adLockBatchOptimistic
If rusrType.RecordCount <> 0 Then
Me.lblusrYype = rusrType.Fields!AType
rusrType.Close
Else
MsgBox " 用户类型不能为空! ", vbCritical
rusrType.Close
Unload Me
End If
End If
Me.Label11 = rstFeeEnd.Fields!Atimes
Me.Label11 = Me.Label11 & "/" & Format(rstFeeEnd.Fields!lMoney, "##0.00")
rstFeeEnd.Fields!nowecount = 0
Me.startA = rstFeeEnd.Fields!LEndPCode & "度"
rstFeeEnd.Fields!lecount = rstFeeEnd.Fields!lecount + rstFeeEnd.Fields!nowecount
'MsgBox MDIme.txtUserName(7)
rstFeeEnd.Fields!lsFee = Val(MDIme.txtUserName(7)) - Val(txtM)
rstFeeEnd.UpdateBatch adAffectCurrent
rstFeeEnd.Close
sqlString = "insert into feels (holderid,holder,feemoney,qianfee,feedate,zhinajin,memols,cname,Ecount) values('" & MDIme.txtUserName(0) & "','" & MDIme.dcvalue.Text & "'," & Val(txtFee.Text) & "," & Val(txtM.Text) & ",#" & Format(Now, "yyyy-mm-dd") & "#," & Val(txtznj) & ",'" & txtPrint & "','" & Guser & "'," & MDIme.txtUserName(1) & ")"
cmdExe.ActiveConnection = gCnn
cmdExe.CommandText = sqlString
cmdExe.Execute
txtPrint.Visible = True
Me.CmdPrint.Visible = True
Frame2.Visible = False
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Caption = MDIme.dcvalue.Text & "用户(住户编号:" & MDIme.txtUserName(0) & " ) 开始交费"
txtFee.Text = MDIme.txtUserName(7)
End Sub
Private Sub Form_Unload(Cancel As Integer)
MDIme.loadData (MDIme.txtUserName(0))
End Sub
Private Sub txtFee_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 And KeyAscii <> 46 And KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0
End Sub
Private Sub txtM_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 And KeyAscii <> 46 And KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0
End Sub
Private Sub txtznj_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 And KeyAscii <> 46 And KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0
End Sub
10:数据查询界面设计:
<< 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] 下一页