📄 xfk_gsh.frm
字号:
VERSION 5.00
Begin VB.Form xfk_gsh
BorderStyle = 1 'Fixed Single
Caption = "消费卡——挂失"
ClientHeight = 2955
ClientLeft = 45
ClientTop = 375
ClientWidth = 7575
Icon = "xfk_gsh.frx":0000
LinkTopic = "Form5"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2955
ScaleWidth = 7575
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "挂 失"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 3000
TabIndex = 2
Top = 1920
Width = 1575
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 3000
TabIndex = 0
Top = 840
Width = 3255
End
Begin VB.CommandButton Command2
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 5400
TabIndex = 1
Top = 1920
Width = 1575
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入卡编号"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 960
TabIndex = 3
Top = 960
Width = 1800
End
End
Attribute VB_Name = "xfk_gsh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim gsh_cn As New Connection
Dim kzl As Recordset
Dim gshjl As Recordset
Private Sub Command1_Click()
Set kzl = New Recordset
kzl.CursorLocation = adUseClient
kzl.CursorType = adOpenDynamic
kzl.LockType = adLockOptimistic
kzl.Open "select * from 卡资料 where 卡编号='" & Trim(Text1.Text) & "'", gsh_cn
If kzl.RecordCount > 0 Then
If Trim(kzl.Fields("卡状态")) = "挂失" Then
MsgBox "本卡已挂失!", vbExclamation, "提示"
Else
If (MsgBox("挂失卡编号为" & Trim(Text1.Text) & "卡,请确认?", vbYesNo + vbCritical + vbDefaultButton1 + vbCritical, "挂失确认")) = vbYes Then
kzl.Fields("卡状态") = "挂失"
kzl.Update
Set gshjl = New Recordset
gshjl.CursorLocation = adUseClient
gshjl.CursorType = adOpenDynamic
gshjl.LockType = adLockOptimistic
gshjl.Open "select top 1 * from 挂失记录", gsh_cn
gshjl.AddNew
gshjl.Fields("卡编号") = CInt(Text1.Text)
gshjl.Fields("日期") = Format(Date, "yyyy-mm-dd")
gshjl.Fields("时间") = Format(Time, "hh:mm:ss")
gshjl.Fields("操作人") = yonghuming
gshjl.Fields("操作") = "挂失"
gshjl.Update
gshjl.Close
MsgBox "挂失成功!", vbExclamation, "提示"
Text1.Text = ""
End If
End If
Else
MsgBox "无此卡编号,请重新输入", vbExclamation, "提示"
End If
Text1.SetFocus
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
gsh_cn.ConnectionString = dblianjie
gsh_cn.Open
End Sub
Private Sub Form_Unload(Cancel As Integer)
gsh_cn.Close
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not (Chr(KeyAscii) Like "[0-9]" Or KeyAscii = vbKeyBack Or KeyAscii = 13) Then
KeyAscii = 0
End If
If KeyAscii = 13 And Text1.Text <> "" Then
Command1.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -