📄 frmxubook.frm
字号:
Width = 5835
Begin VB.TextBox Text2
Height = 300
Left = 4200
TabIndex = 5
Top = 960
Width = 1455
End
Begin VB.TextBox Text1
Height = 300
Left = 1080
TabIndex = 4
Top = 960
Width = 1605
End
Begin VB.TextBox Text3
Height = 300
Left = 1080
TabIndex = 0
Top = 240
Width = 1605
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 300
Left = 1080
TabIndex = 2
Top = 600
Width = 1605
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 300
Left = 4200
TabIndex = 3
Top = 555
Width = 1455
_ExtentX = 2566
_ExtentY = 529
_Version = 393216
Enabled = 0 'False
Format = 19726337
CurrentDate = 38313
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 300
Left = 4200
TabIndex = 1
Top = 225
Width = 1455
_ExtentX = 2566
_ExtentY = 529
_Version = 393216
Format = 19726337
CurrentDate = 38309
End
Begin VB.Label Label1
Caption = "读者编号:"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 15
Top = 1080
Width = 975
End
Begin VB.Label Label2
Caption = "读者姓名:"
ForeColor = &H00C00000&
Height = 255
Left = 2880
TabIndex = 14
Top = 1080
Width = 975
End
Begin VB.Label Label3
Caption = "条 码 号:"
ForeColor = &H000000C0&
Height = 255
Left = 135
TabIndex = 10
Top = 360
Width = 960
End
Begin VB.Label Label4
Caption = "借书日期改为:"
ForeColor = &H00C00000&
Height = 255
Left = 2880
TabIndex = 9
Top = 360
Width = 1335
End
Begin VB.Label Label5
Caption = "书籍名称:"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 8
Top = 720
Width = 975
End
Begin VB.Label Label6
Caption = "还书日期改为:"
ForeColor = &H00C00000&
Height = 255
Left = 2880
TabIndex = 7
Top = 720
Width = 1335
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmxubook.frx":0000
Height = 1860
Left = 90
TabIndex = 11
Top = 1680
Width = 5880
_ExtentX = 10372
_ExtentY = 3281
_Version = 393216
BackColor = 12640511
ForeColor = 4210752
HeadLines = 1
RowHeight = 15
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 = 2
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
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.Line Line1
BorderColor = &H80000005&
BorderWidth = 3
X1 = 120
X2 = 5910
Y1 = 1560
Y2 = 1560
End
End
Attribute VB_Name = "frmxubook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
Dim sql, i As String
Dim sql1, sql2 As String
i = MsgBox("是否保存此条记录!", vbYesNo + vbOKOnly, "提示")
If i = vbYes Then
Adodc4.RecordSource = "select * from sz "
Adodc4.Refresh
If Text4.Text > Adodc4.Recordset.Fields(0) Then
MsgBox "最大借书数量" & Val(Adodc4.Recordset.Fields(0)) & "本!", vbOKOnly, "提示"
Exit Sub
End If
' If Adodc1.Recordset.Fields(8) = Adodc4.Recordset.Fields(0) Then
' MsgBox "您的借书数量已满!", vbOKOnly, "提示"
' End If
sql = "update dzjstb set 借书日期='" & DTPicker1 & "',应还日期='" & DTPicker2 & "',借书数量='" & Text4.Text & "',借='借' where 条码号 = '" & Text3.Text & "'"
cnn.Execute (sql)
' Adodc3.RecordSource = "select * from books where 条码号='" & Text3.Text & "'"
' Adodc3.Refresh
' If Adodc3.Recordset.RecordCount > 0 Then
' sql1 = "update books set 复本数=' " & 复本数 - Val(Text4.Text) & "' where 条码号='" & Text3.Text & "'"
' cnn.Execute (sql1)
' sql2 = "update books set 借书数量='" & Val(Text4.Text) & "'where 条码号 ='" & Text3.Text & "'"
' cnn.Execute (sql2)
' End If
End If
Adodc1.Refresh
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub DTPicker1_Change()
' DTPicker2.Value = DTPicker1.Value + Val(Adodc1.Recordset.Fields(5))
End Sub
Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text1.SetFocus
End Sub
Private Sub DTPicker1_LostFocus()
DTPicker2.Value = DTPicker1.Value + Val(Adodc1.Recordset.Fields(5))
End Sub
Private Sub Form_Activate()
Text3.SetFocus
DTPicker1.Value = Date
' DTPicker2.Value = DTPicker1.Value + Val(Adodc1.Recordset.Fields(5))
End Sub
Private Sub Form_Load()
Me.Show
Set rs = New ADODB.Recordset
' rs.Open "dzjstb", cn, adOpenStatic, adLockOptimistic, adCmdTable
Me.Caption = Me.Caption & " " & frmmain.StatusBar1.Panels(2).Text
Adodc1.RecordSource = "select * from dzjstb where 借='借'"
Adodc1.Refresh
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Adodc5.RecordSource = "select * from dzjstb where 条码号='" & Trim(Text3.Text) & "' and 读者编号='" & Trim(Text1.Text) & "'"
Adodc5.Refresh
If Adodc5.Recordset.RecordCount > 0 Then
Text1.Text = Adodc5.Recordset.Fields("读者编号")
Text2.Text = Adodc5.Recordset.Fields("读者姓名")
Text5.Text = Adodc5.Recordset.Fields("书籍名称")
Text4.Text = Adodc5.Recordset.Fields("借书数量")
Else
MsgBox "没有此图书的借阅信息!!", vbOKOnly, "提示"
Text1.Text = ""
Text1.SetFocus
End If
Else
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 DTPicker1.SetFocus
End Sub
Private Sub Text3_LostFocus()
If Text3.Text = "" Then
Exit Sub
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -