📄 frmshoukuanlogin.frm
字号:
VERSION 5.00
Begin VB.Form Frmshoukuanlogin
BackColor = &H00C0FFC0&
Caption = "收款管理"
ClientHeight = 5745
ClientLeft = 60
ClientTop = 450
ClientWidth = 8760
LinkTopic = "Form1"
ScaleHeight = 5745
ScaleWidth = 8760
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture1
Height = 4335
Left = 120
Picture = "Frmshoukuanlogin.frx":0000
ScaleHeight = 4275
ScaleWidth = 8475
TabIndex = 5
Top = 600
Width = 8535
Begin VB.ComboBox Combo2
Height = 300
Left = 3840
TabIndex = 10
Top = 1750
Width = 1335
End
Begin VB.TextBox txtloupannum
Height = 350
Left = 1680
TabIndex = 9
Top = 720
Width = 1335
End
Begin VB.TextBox txtprice
Height = 270
Left = 6480
TabIndex = 8
Top = 1750
Width = 1215
End
Begin VB.TextBox txtskr
Height = 390
Left = 4680
TabIndex = 7
Top = 3840
Width = 1095
End
Begin VB.TextBox txtjkr
Height = 390
Left = 6600
TabIndex = 6
Top = 3840
Width = 1455
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
Height = 255
Left = 4440
TabIndex = 16
Top = 850
Width = 375
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
Height = 255
Left = 5100
TabIndex = 15
Top = 850
Width = 210
End
Begin VB.Label Label4
BackColor = &H00FFFFFF&
Height = 255
Left = 5520
TabIndex = 14
Top = 850
Width = 255
End
Begin VB.Label Label5
BackColor = &H00FFFFFF&
Height = 255
Left = 7680
TabIndex = 13
Top = 840
Width = 735
End
Begin VB.Label Label6
BackColor = &H00FFFFFF&
Height = 255
Left = 1440
TabIndex = 12
Top = 3360
Width = 4095
End
Begin VB.Label Label7
BackColor = &H00FFFFFF&
Height = 255
Left = 6600
TabIndex = 11
Top = 3360
Width = 1335
End
End
Begin VB.ComboBox Combofind
Height = 300
Left = 1440
TabIndex = 4
Top = 120
Width = 1815
End
Begin VB.CommandButton cmdsave
Caption = "保存"
Height = 375
Left = 1080
TabIndex = 3
Top = 5160
Width = 800
End
Begin VB.CommandButton cmddel
Caption = "删除"
Height = 375
Left = 2880
TabIndex = 2
Top = 5160
Width = 800
End
Begin VB.CommandButton cdmprint
Caption = "打印"
Height = 375
Left = 4560
TabIndex = 1
Top = 5160
Width = 800
End
Begin VB.CommandButton cmdexit
Caption = "退出"
Height = 375
Left = 6360
TabIndex = 0
Top = 5160
Width = 800
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00C0FFC0&
Caption = "选择单据编号:"
Height = 180
Left = 120
TabIndex = 17
Top = 150
Width = 1260
End
End
Attribute VB_Name = "Frmshoukuanlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs_shoukuan As New ADODB.Recordset
Private Sub cdmprint_Click()
Printer.Print " "
Printer.PaintPicture Picture1.Picture, 0, 0
Printer.EndDoc
End Sub
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdsave_Click()
Dim i As Integer
If Trim(txtmoney(0).Text) = "" Then
MsgBox "楼盘编号不能为空!", vbOKOnly + vbExclamation, "系统提示!"
txtmoney(0).SetFocus
Exit Sub
End If
Dim fee As Currency
fee = 0
For i = 1 To 6
fee = fee + CCur(txtmoney(i).Text)
Next i
txtmoney(7).Text = CStr(fee)
Label6.Caption = ChineseFormat(fee)
rs_shoukuan.AddNew
rs_shoukuan.Fields(0) = Label4
rs_shoukuan.Fields(1) = txtmoney(0).Text
rs_shoukuan.Fields(2) = Date
For i = 1 To 6
rs_shoukuan.Fields(i + 2) = txtmoney(i).Text
Next i
rs_shoukuan.Fields(9) = txtskr.Text
rs_shoukuan.Fields(10) = txtjkr.Text
rs_shoukuan.Update
MsgBox "保存成功!", vbOKOnly + vbExclamation, "系统提示!"
Exit Sub
End Sub
Private Sub cmdprint_Click()
Dim X%
X% = BitBlt(Picture1.hDC, 0, 0, Picture1.Width, Picture1.Height, _
Picture1.hDC, 0, 0, SRCCOPY)
Picture1.Picture = Picture1.Image
Printer.PaintPicture Picture1.Picture, 0, 0
End Sub
Private Sub Form_Load()
Dim sql As String
Dim i As Integer
On Error GoTo loaderror
sql = "select * from 收款登记"
rs_shoukuan.CursorLocation = adUseClient
rs_shoukuan.Open sql, conn, adOpenKeyset, adLockPessimistic
i = rs_shoukuan.RecordCount
Label2.Caption = Year(Date)
Label3.Caption = Month(Date)
Label4.Caption = Day(Date)
Label5.Caption = Format(i + 1, "000000")
Exit Sub
loaderror:
MsgBox Err.Description
End Sub
Function ChineseFormat(n As Variant)
Dim s As String, sFormat As String
Dim i As Integer, c As String
Const sString = "分角元拾佰仟万拾佰仟亿拾佰仟万"
Const sNumber = "零壹贰叁肆伍陆柒捌玖"
s = Format(Int(n * 100))
sFormat = ""
For i = Len(s) To 1 Step -1
c = Mid(s, i, 1)
sFormat = Mid(sNumber, Val(c) _
+ 1, 1) + Mid(sString, Len(s) - i + 1, 1) _
+ sFormat
Next
ChineseFormat = sFormat
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -