📄 取款.frm
字号:
VERSION 5.00
Begin VB.Form Form8
BackColor = &H00FFC0C0&
Caption = "Form8"
ClientHeight = 5580
ClientLeft = 60
ClientTop = 450
ClientWidth = 10320
LinkTopic = "Form8"
Picture = "取款.frx":0000
ScaleHeight = 5580
ScaleWidth = 10320
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "取款信息"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 3375
Left = 2280
TabIndex = 0
Top = 1200
Width = 5295
Begin VB.CommandButton Command3
Caption = "取款"
Height = 495
Left = 2640
Picture = "取款.frx":4F4CC
Style = 1 'Graphical
TabIndex = 10
Top = 2640
Width = 2175
End
Begin VB.TextBox Text3
Height = 495
Left = 2640
TabIndex = 9
Top = 2040
Width = 2175
End
Begin VB.TextBox Text1
Height = 495
Left = 2640
TabIndex = 8
Top = 840
Width = 2175
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 7
Top = 1440
Width = 2175
End
Begin VB.OptionButton Option2
BackColor = &H00FFC0C0&
Caption = "帐"
Height = 495
Left = 2760
TabIndex = 6
Top = 240
Width = 1695
End
Begin VB.OptionButton Option1
BackColor = &H00FFC0C0&
Caption = "卡"
Height = 495
Left = 1080
TabIndex = 5
Top = 240
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "返回"
Height = 495
Left = 600
Picture = "取款.frx":57DA2
Style = 1 'Graphical
TabIndex = 4
Top = 2640
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "取款金额"
Height = 495
Index = 3
Left = 600
Picture = "取款.frx":60678
Style = 1 'Graphical
TabIndex = 3
Top = 2040
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "密码"
Height = 495
Index = 2
Left = 600
Picture = "取款.frx":68F4E
Style = 1 'Graphical
TabIndex = 2
Top = 1440
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "卡号|折号"
Height = 495
Index = 1
Left = 600
Picture = "取款.frx":71824
Style = 1 'Graphical
TabIndex = 1
Top = 840
Width = 1575
End
End
End
Attribute VB_Name = "Form8"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public yg8 As String
Public yh8 As String
Dim cash As Integer
Dim lost As Integer
Private Sub Command2_Click()
Unload Me
Form3.Show
End Sub
Private Sub Command3_Click()
Dim nowTime As String
nowTime = Now
If Option1.Value = False And Option2.Value = False Then
MsgBox "请选择卡还是帐户取款!"
Text1.SetFocus
ElseIf Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
MsgBox "输入不能为空!"
Text1.SetFocus
Exit Sub
ElseIf Not IsNumeric(Text1.Text) Or Len(Text1.Text) <> 18 Then
MsgBox "输入不正确"
Text1.SetFocus
Exit Sub
ElseIf Not IsNumeric(Text3.Text) Then
MsgBox "取款金额输入不对"
Text3.SetFocus
ElseIf Option1.Value = True Then
Call openconn
rs.Open "select * from card_xx053_06 where c_No='" & Trim(Text1.Text) & "'and c_key='" & Trim(Text2.Text) & "'", conn, adOpenDynamic, adLockOptimistic
If rs.BOF And rs.EOF Then
MsgBox "输入不正确!请从新输入"
Unload Me
Form8.Show
Else
cash = rs!balance
If rs!lost = True Then
MsgBox "此卡已被挂失!"
rs.Close
Unload Me
Form3.Show
ElseIf cash < Trim(Text3.Text) Then
MsgBox "卡上余额不足!请从新输入取款金额!"
Unload Me
Form8.Show
Else
rs.Fields(3) = cash - Trim(Text3.Text)
rs.Update
rs.Close
rs.Open "select * from access_xx053_06 ", conn, adOpenDynamic, adLockOptimistic
conn.Execute "insert into access_xx053_06 values(0,'" & Trim(Text3.Text) & "','" & nowTime & "','" & yh8 & "','" & yg8 & "','" & Trim(Text1.Text) & "',null)"
MsgBox "取款成功!"
rs.Close
Unload Me
Form3.Show
End If
End If
Else
Call openconn
rs.Open "select * from account_xx053_06 where b_No='" & Trim(Text1.Text) & "'and b_key='" & Trim(Text2.Text) & "'", conn, adOpenDynamic, adLockOptimistic
If rs.BOF And rs.EOF Then
MsgBox "输入不正确!请从新输入"
Unload Me
Form8.Show
Else
cash = rs!balance
If rs!lost = True Then
MsgBox "此卡已被挂失!"
rs.Close
Unload Me
Form3.Show
ElseIf cash < Trim(Text3.Text) Then
MsgBox "卡上余额不足!请从新输入取款金额!"
Unload Me
Form8.Show
Else
rs.Fields(7) = cash - Trim(Text3.Text)
rs.Update
rs.Close
rs.Open "select * from access_xx053_06 ", conn, adOpenDynamic, adLockOptimistic
conn.Execute "insert into access_xx053_06 values(0,'" & Trim(Text3.Text) & "','" & nowTime & "','" & yh8 & "','" & yg8 & "',null,'" & Trim(Text1.Text) & "')"
MsgBox "取款成功!"
rs.Close
Unload Me
Form3.Show
End If
End If
conn.Close
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -