📄 edreader1.frm
字号:
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 375
Left = 1800
TabIndex = 7
Top = 240
Width = 735
End
Begin VB.OptionButton Option1
Caption = "男"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 375
Left = 840
TabIndex = 6
Top = 240
Width = 615
End
End
Begin VB.TextBox Text2
Height = 375
Left = 4800
TabIndex = 4
Text = "Text2"
Top = 600
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 2
Text = "Text1"
Top = 600
Width = 1815
End
Begin VB.Label Label8
Caption = "日期格式:yy-mm-dd"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 375
Left = 4680
TabIndex = 20
Top = 4800
Width = 2295
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "登记日期*"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 240
Left = 840
TabIndex = 18
Top = 4800
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "单 位"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 240
Left = 3840
TabIndex = 8
Top = 1560
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "姓 名*"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 240
Left = 3840
TabIndex = 3
Top = 600
Width = 840
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "借阅证号*"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 240
Left = 480
TabIndex = 1
Top = 600
Width = 1080
End
End
End
Attribute VB_Name = "edreader1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Private Sub Command1_Click()
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Or Trim(Text4.Text) = "" Or Trim(Text8.Text) = "" Then
MsgBox "加*项不能为空!", vbOKOnly, , "信息提示"
Exit Sub
End If
If flag = 1 Then
sqltxt = "select * from reader where 借阅证号='" + Trim(Text1.Text) + "'"
Set rs = exesql(sqltxt)
If rs.RecordCount <> 0 Then
MsgBox "存在相同的借阅证号", vbOKOnly, "信息提示"
Text1.SetFocus
Exit Sub
Else
rs.Close
End If
edreader.Adodc1.Recordset.AddNew
edreader.Adodc1.Recordset.Fields("借阅证号") = Trim(Text1.Text)
edreader.Adodc1.Recordset.Fields("姓名") = Trim(Text2.Text)
If Option1.Value = True Then
edreader.Adodc1.Recordset.Fields("性别") = "男"
Else
edreader.Adodc1.Recordset.Fields("性别") = "女"
End If
edreader.Adodc1.Recordset.Fields("单位") = Trim(Text3.Text)
edreader.Adodc1.Recordset.Fields("级别") = Trim(Text4.Text)
edreader.Adodc1.Recordset.Fields("过期罚款") = Trim(Text5.Text)
edreader.Adodc1.Recordset.Fields("借书总数") = Val(Trim(Text6.Text))
edreader.Adodc1.Recordset.Fields("借书天数") = Val(Trim(Text7.Text))
edreader.Adodc1.Recordset.Fields("已借书数") = 0
edreader.Adodc1.Recordset.Fields("登记日期") = Format(Trim(Text8.Text), "yyyy-mm-dd")
edreader.Adodc1.Recordset.Update
recs = recs + 1
Else
edreader.Adodc1.Recordset.Fields("借阅证号") = Trim(Text1.Text)
edreader.Adodc1.Recordset.Fields("姓名") = Trim(Text2.Text)
If Option1.Value = True Then
edreader.Adodc1.Recordset.Fields("性别") = "男"
Else
edreader.Adodc1.Recordset.Fields("性别") = "女"
End If
edreader.Adodc1.Recordset.Fields("单位") = Trim(Text3.Text)
edreader.Adodc1.Recordset.Fields("级别") = Trim(Text4.Text)
edreader.Adodc1.Recordset.Fields("过期罚款") = Trim(Text5.Text)
edreader.Adodc1.Recordset.Fields("借书总数") = Val(Trim(Text6.Text))
edreader.Adodc1.Recordset.Fields("借书天数") = Val(Trim(Text7.Text))
edreader.Adodc1.Recordset.Fields("登记日期") = Format(Trim(Text8.Text), "yyyy-mm-dd")
edreader.Adodc1.Recordset.Update
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Adodc1.Refresh
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
If flag = 2 Then
Text1.Text = edreader.Adodc1.Recordset.Fields("借阅证号") & ""
Text2.Text = edreader.Adodc1.Recordset.Fields("姓名") & ""
If edreader.Adodc1.Recordset.Fields("性别") = "男" Then
Option1.Value = True
Else
Option2.Value = True
End If
Text3.Text = edreader.Adodc1.Recordset.Fields("单位") & ""
Text4.Text = edreader.Adodc1.Recordset.Fields("级别") & ""
Text5.Text = edreader.Adodc1.Recordset.Fields("过期罚款") & ""
Text6.Text = edreader.Adodc1.Recordset.Fields("借书总数") & ""
Text7.Text = edreader.Adodc1.Recordset.Fields("借书天数") & ""
Text8.Text = edreader.Adodc1.Recordset.Fields("登记日期") & ""
Text1.Enabled = False
Else
Text8.Text = Date
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -