📄 frmcardsedit.frm
字号:
VERSION 5.00
Begin VB.Form FrmCardsEdit
BorderStyle = 1 'Fixed Single
Caption = "编辑借阅证信息"
ClientHeight = 4110
ClientLeft = 45
ClientTop = 330
ClientWidth = 8760
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4110
ScaleWidth = 8760
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Cmd_UnLost
Caption = "取消挂失"
Default = -1 'True
Height = 400
Left = 7200
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 15
Top = 2160
Width = 1300
End
Begin VB.CommandButton Cmd_Lost
Caption = "挂 失"
Height = 400
Left = 7200
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 14
Top = 1320
Width = 1300
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Height = 400
Left = 7200
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 3
Top = 360
Width = 1300
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 7200
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 4
Top = 3000
Width = 1300
End
Begin VB.Frame Frame1
Height = 3855
Left = 240
TabIndex = 5
Top = 0
Width = 6735
Begin VB.TextBox txtCardNo
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1680
MaxLength = 100
TabIndex = 16
Top = 300
Width = 4575
End
Begin VB.TextBox txtCreateDate
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1680
MaxLength = 20
TabIndex = 6
Top = 2640
Width = 4575
End
Begin VB.TextBox txtEmpName
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1680
MaxLength = 50
TabIndex = 1
Top = 1440
Width = 4575
End
Begin VB.TextBox txtIdCard
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1680
MaxLength = 20
TabIndex = 2
Top = 2040
Width = 4575
End
Begin VB.TextBox txtDepName
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1680
MaxLength = 100
TabIndex = 0
Top = 840
Width = 4575
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "借阅证编号"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 13
Top = 360
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "有效证件号码"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 12
Top = 2160
Width = 1080
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "员工姓名"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 11
Top = 1560
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "所属部门"
Height = 180
Left = 360
TabIndex = 10
Top = 960
Width = 720
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "发证日期"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 9
Top = 2760
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "状 态"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 8
Top = 3360
Width = 720
End
Begin VB.Label lbl_Flag
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "有效"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 1680
TabIndex = 7
Top = 3360
Width = 720
End
End
End
Attribute VB_Name = "FrmCardsEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean '插入=false,修改=true
Public OriCardNo As String
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
'检查用户录入数据的有效性
If Len(Trim(txtCardNo)) = 0 Then
MsgBox "请输入借阅证号!"
txtCardNo.SetFocus
txtCardNo.SelStart = 0
txtCardNo.SelLength = Len(txtCardNo)
Exit Sub
End If
If Len(Trim(txtEmpName)) = 0 Then
MsgBox "请输入员工姓名"
txtEmpName.SetFocus
txtEmpName.SelStart = 0
txtEmpName.SelLength = Len(txtEmpName)
Exit Sub
End If
If Len(Trim(txtIdCard)) = 0 Then
MsgBox "请输入有效证件号码"
txtIdCard.SetFocus
txtIdCard.SelStart = 0
txtIdCard.SelLength = Len(txtIdCard)
Exit Sub
End If
If Len(Trim(txtCreateDate)) = 0 Then
MsgBox "请输入发证日期"
txtCreateDate.SetFocus
txtCreateDate.SelStart = 0
txtCreateDate.SelLength = Len(txtCreateDate)
Exit Sub
End If
'把用户录入的数据赋值到数据库对象变量中
With MyCards
.Cardno = MakeStr(txtCardNo)
.DepName = MakeStr(txtDepName)
.EmpName = MakeStr(txtEmpName)
.Idcard = MakeStr(txtIdCard)
.CreateDate = MakeStr(txtCreateDate)
If (Trim(lbl_Flag) = Trim("有效")) Then
.Flag = 0
Else
.Flag = 1
End If
'根据变量Modify的值,决定是插入新数据,还是修改已有的数据
If Modify = False Then
.Insert
Else
Call .Update(OriCardNo)
End If
End With
'关闭窗口
Unload Me
End Sub
Private Sub Cmd_Lost_Click()
'设置Flag=1为挂失
Call MyCards.UpdateFlag(OriCardNo, 1)
Unload Me
End Sub
Private Sub Cmd_UnLost_Click()
lbl_Flag.Caption = "有效"
Call MyCards.UpdateFlag(OriCardNo, 0)
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -