📄 frmdzjsgl.frm
字号:
Left = 120
TabIndex = 19
Top = 2745
Width = 5655
_ExtentX = 9975
_ExtentY = 2910
_Version = 393216
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 13
BeginProperty Column00
DataField = "读者编号"
Caption = "读者编号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "读者姓名"
Caption = "读者姓名"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "条码号"
Caption = "条码号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column03
DataField = "书籍名称"
Caption = "书籍名称"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column04
DataField = "书籍价格"
Caption = "书籍价格"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column05
DataField = "规定天数"
Caption = "规定天数"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column06
DataField = "出版社"
Caption = "出版社"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column07
DataField = "作者"
Caption = "作者"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column08
DataField = "借书数量"
Caption = "借书数量"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column09
DataField = "类别代码"
Caption = "类别代码"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column10
DataField = "借书日期"
Caption = "借书日期"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column11
DataField = "应还日期"
Caption = "应还日期"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column12
DataField = "借"
Caption = "图书状态"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 2085.166
EndProperty
BeginProperty Column01
ColumnWidth = 1365.165
EndProperty
BeginProperty Column02
ColumnWidth = 2085.166
EndProperty
BeginProperty Column03
ColumnWidth = 2085.166
EndProperty
BeginProperty Column04
ColumnWidth = 2085.166
EndProperty
BeginProperty Column05
ColumnWidth = 2085.166
EndProperty
BeginProperty Column06
ColumnWidth = 2085.166
EndProperty
BeginProperty Column07
ColumnWidth = 2085.166
EndProperty
BeginProperty Column08
ColumnWidth = 1094.74
EndProperty
BeginProperty Column09
ColumnWidth = 915.024
EndProperty
BeginProperty Column10
ColumnWidth = 2085.166
EndProperty
BeginProperty Column11
ColumnWidth = 2085.166
EndProperty
BeginProperty Column12
ColumnWidth = 824.882
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmdzjsgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Dim x, y As Integer
Dim hs1
Private Sub Command1_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text9.Text = "" Then
MsgBox "输入的借书信息不完全!", , "提示信息"
Else
rs.Open "select sum(借书数量) from dzjstb where 读者编号='" + Text1.Text + "'", cnn, adOpenKeyset, adLockOptimistic
Adodc3.RecordSource = "select * from sz"
Adodc3.Refresh
If rs.Fields(0) + Val(Text9.Text) > Adodc3.Recordset.Fields(0) Then
MsgBox "您的借书量已满!!", vbOKOnly, "提示"
rs.Close
Exit Sub
Else
Adodc2.RecordSource = "select * from books where 条码号='" + Text3.Text + "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
cnn.Execute ("insert into dzjstb values('" & Text1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "'," & Text5.Text & ",'" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & Text10 & "','" & DTPicker1 & "','" & DTPicker2 & "','借')")
x = Val(Adodc2.Recordset.Fields("复本数")) - Val(Text9.Text)
y = Val(Adodc2.Recordset.Fields("借书数量")) + Val(Text9.Text)
hs1 = "update books set 复本数='" & x & "',借书数量='" & y & "'where 条码号='" & Text3.Text & "'"
cnn.Execute (hs1)
Else
End If
End If
' Adodc1.Refresh
' Dim temp As Integer
' temp = Val(Adodc2.Recordset.Fields("复本数")) - Val(Text9.Text)
'' cnn.Execute ("update books set 复本数='" + temp + "' where 条码号='" & Text3.Text & "'")
' cnn.Execute ("update books set 借书数量=借书数量 +" & Text9.Text & " where 条码号='" & Text3.Text & "'")
MsgBox "借出完毕!", vbOKOnly, "提示"
Set rs = Nothing
End If
End Sub
Private Sub Command2_Click()
If Adodc1.Recordset.EOF = False Then
If Text1.Text = "" Then
Exit Sub
Else
c = MsgBox("您确认要删除该记录吗?", 17, "提示信息")
If c = vbOK Then
Call main
Set adoRs = adoCon.Execute("delete from dzjstb where 读者编号='" + Text1.Text + "'")
' Adodc1.Recordset.Delete
Adodc1.Refresh
adoCon.Close
Else
End If
End If
Else
MsgBox "当前数据库中已经没有可删除的记录", 64, "提示信息"
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Sub clear()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text1.SetFocus
End Sub
Private Sub Command4_Click()
clear
End Sub
Private Sub Form_Activate()
DTPicker1.Value = Date
Text1.SetFocus
End Sub
Private Sub Form_Load()
Adodc1.RecordSource = "select * from dzjstb where 借='借'"
Adodc1.Refresh
Me.Caption = Me.Caption & " " & frmmain.StatusBar1.Panels(2).Text
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Adodc2.RecordSource = "select * from dzxxtb where 读者编号='" & Text1.Text & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Text2.Text = Adodc2.Recordset.Fields(1)
Text3.SetFocus
Else
MsgBox "没有该读者信息!", vbOKOnly, "提示"
Text2.Text = ""
Text1.SetFocus
End If
Else
End If
End Sub
'Private Sub Text1_LostFocus()
' If Text1.Text = "" Then
' Exit Sub
' Else
' If Text1.Text = "" Then
' MsgBox "请先输入读者编号", vbOKOnly, "提示"
' End If
' End If
'End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text3.SetFocus
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text4.SetFocus
End Sub
Private Sub Text3_LostFocus()
Adodc2.RecordSource = "select * from books where 条码号='" & Text3.Text & "'"
On Error Resume Next
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Text4.Text = Adodc2.Recordset.Fields("书籍名称")
Else
MsgBox "没有该书籍信息!", vbOKOnly, "提示"
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
End If
Text5.Text = Adodc2.Recordset.Fields("订购价格")
Text6.Text = Adodc2.Recordset.Fields("规定天数")
Text7.Text = Adodc2.Recordset.Fields("出版社")
Text8.Text = Adodc2.Recordset.Fields("作者")
Text10.Text = Adodc2.Recordset.Fields("类别代码")
DTPicker2.Value = DTPicker1.Value + Val(Text6.Text)
Set rs = Nothing
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text5.SetFocus
End Sub
Private Sub text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text6.SetFocus
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text7.SetFocus
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text8.SetFocus
End Sub
Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text9.SetFocus
End Sub
Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text10.SetFocus
End Sub
Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text11.SetFocus
End Sub
Private Sub Text9_LostFocus()
If Text9.Text = "" Then
MsgBox "借书数量不能为空!", , "提示信息"
Text9.SetFocus
Else
Adodc3.RecordSource = "select * from sz"
Adodc3.Refresh
If Adodc3.Recordset.RecordCount > 0 Then
If Val(Text9.Text) > Val(Adodc3.Recordset.Fields(0)) Then
MsgBox " 借书数量大于系统所规定的借出数量,请您查看系统管理当中的系统设置后再重新输入借书数量的信息", vbOKOnly, "提示"
Text9.Text = ""
Text9.SetFocus
End If
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -