📄 frmfetch.frm
字号:
VERSION 5.00
Begin VB.Form frmFetch
BackColor = &H00404040&
BorderStyle = 1 'Fixed Single
Caption = "取款"
ClientHeight = 3120
ClientLeft = 45
ClientTop = 435
ClientWidth = 7275
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3120
ScaleWidth = 7275
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取 消"
Height = 345
Left = 3840
TabIndex = 5
Top = 2520
Width = 975
End
Begin VB.CommandButton cmdFinally
Caption = "完 成"
Default = -1 'True
Height = 345
Left = 2520
TabIndex = 4
Top = 2520
Width = 975
End
Begin VB.TextBox txt
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 0
Left = 2880
TabIndex = 1
Top = 960
Width = 2415
End
Begin VB.TextBox txt
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 1
Left = 2880
TabIndex = 2
Top = 1440
Width = 2415
End
Begin VB.TextBox txt
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Index = 2
Left = 2880
TabIndex = 3
Top = 1920
Width = 2415
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入帐户号码:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 4
Left = 1320
TabIndex = 8
Top = 1080
Width = 1440
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入取款金额:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 1
Left = 1320
TabIndex = 7
Top = 1560
Width = 1440
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请再次输入取款金额:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 3
Left = 960
TabIndex = 6
Top = 2040
Width = 1800
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "取款"
BeginProperty Font
Name = "华文新魏"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 315
Index = 2
Left = 3240
TabIndex = 0
Top = 240
Width = 630
End
Begin VB.Line line
BorderColor = &H00FFFFFF&
BorderWidth = 2
X1 = 0
X2 = 7560
Y1 = 600
Y2 = 600
End
End
Attribute VB_Name = "frmFetch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim money As Double
Dim balance As Double
Dim rst As Recordset
Dim password As String
Dim i As Integer
Dim nowDate As String
Dim DDate As String
Dim nowTime As String
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdFinally_Click()
Set rst = New Recordset
nowTime = Now
nowDate = Format(nowTime, "yyyy") + Format(nowTime, "mm") + Format(nowTime, "dd") + Format(nowTime, "hh") + Format(nowTime, "nn") + Format(nowTime, "ss")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'验证用户输入的正确性↓
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''取款金额的正确性↓
If txt(1) <> txt(2) Then
MsgBox "请确定两次输入的取款金额相同!"
Exit Sub
End If
''''''''''''''''''''''''''''''''''''金额输入的正确性↓
Dim getErr As Boolean
getErr = True
On Error GoTo errMoney
money = CDbl(txt(1).Text)
getErr = False
errMoney:
If getErr = True Then
MsgBox "请确定您所输入的金额是数值!"
Exit Sub
End If
''''''''''''''''''''''''''''''''''''账户的正确性
Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
con.Open
getErr = True
On Error GoTo errID
rst.Open "select * from CConsumers where id='" & txt(0).Text & "'", con, adOpenDynamic, adLockOptimistic
rst.Close
getErr = False
errID:
If getErr = True Then
MsgBox "您所输入的帐户号不存在!"
Exit Sub
End If
Call frmQuery.QueryID(txt(0).Text)
'''''''''''''''''''''''''''''''''''''''''''取款金额的大小的正确性↓
Dim have As Boolean
have = False
On Error GoTo errHave
rst.Open "select * from " & txt(0).Text, con, adOpenDynamic, adLockOptimistic
rst.MoveFirst
have = True
errHave:
If have = False Then
MsgBox "您的银行余额为0,不能进行存款!"
Exit Sub
Else
i = 0
Do While Not rst.EOF
i = i + 1
rst.MoveNext
Loop
End If
If i = 1 Then
rst.MoveFirst
Else
rst.MoveLast
End If
If money > CDbl(rst!balance) Then
MsgBox "此帐户的银行余额为 " & CDbl(rst!balance)
MsgBox "取款金额大于银行余额,不能提取!"
Exit Sub
Else
balance = CDbl(rst!balance)
DDate = CDbl(rst!Wdate)
End If
rst.Close
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'如果输入全部正确,则↓
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
frmIBF.passTime = (CDbl(Mid(nowDate, 1, 4)) - CDbl(Mid(DDate, 1, 4))) * 12 + (CDbl(Mid(nowDate, 5, 2)) - CDbl(Mid(DDate, 5, 2)))
frmIBF.consumerID = txt(0).Text
frmIBF.consumerMoney = money
frmIBF.balance = balance
frmIBF.nowDate = nowDate
frmIBF.nowTime = nowTime
frmIBF.DDate = DDate
frmIBF.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -