?? lentfrm.frm
字號(hào):
Index = 1
Left = 240
TabIndex = 18
Top = 2160
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "類別"
ForeColor = &H00000000&
Height = 180
Index = 0
Left = 4920
TabIndex = 16
Top = 360
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "今天日期"
ForeColor = &H00000000&
Height = 180
Index = 9
Left = 2520
TabIndex = 12
Top = 2160
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "出版社"
ForeColor = &H00000000&
Height = 180
Index = 10
Left = 240
TabIndex = 11
Top = 1560
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "價(jià)格"
ForeColor = &H00000000&
Height = 180
Index = 11
Left = 3000
TabIndex = 10
Top = 360
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "書 名"
ForeColor = &H00000000&
Height = 180
Index = 12
Left = 240
TabIndex = 9
Top = 960
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "圖書編號(hào)"
ForeColor = &H00000000&
Height = 180
Index = 13
Left = 240
TabIndex = 8
Top = 360
Width = 720
End
End
Begin VB.CommandButton cmdOkCancel
Caption = "歸還圖書(&C)"
Height = 495
Index = 1
Left = 5640
Style = 1 'Graphical
TabIndex = 1
ToolTipText = "歸還當(dāng)前圖書"
Top = 5280
Visible = 0 'False
Width = 1695
End
Begin VB.Image Image3
Height = 480
Left = 5400
Picture = "Lentfrm.frx":0FD0
Top = 480
Width = 480
End
Begin VB.Image Image1
Height = 480
Left = 120
Picture = "Lentfrm.frx":1412
Top = 600
Width = 480
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "輸入要還的圖書編號(hào)"
ForeColor = &H00FF0000&
Height = 180
Index = 1
Left = 720
TabIndex = 15
Top = 720
Width = 1620
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "Enter"
ForeColor = &H000000FF&
Height = 180
Index = 3
Left = 5520
TabIndex = 14
Top = 960
Width = 450
End
Begin VB.Line Line2
BorderColor = &H8000000D&
Index = 1
X1 = 0
X2 = 7440
Y1 = 1320
Y2 = 1320
End
End
End
Attribute VB_Name = "Lentfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst2 As Recordset '打開表BookFlag
Dim rst3 As Recordset '打開表Book
Dim rst1 As Recordset '打開表personal
Dim db2 As Database
Dim db3 As Database
Dim db1 As Database
Dim db As Database
Dim rst As Recordset
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOkCancel_Click(Index As Integer)
Select Case Index
Case 1
rst2.Seek "=", txtBookBian1.Text
If rst2.NoMatch Then
MsgBox "沒有借過這本書!是不是編號(hào)錯(cuò)了?", 0 + 48, "提示"
txtBookBian1.Text = ""
txtBookBian1.SetFocus
Frame6.Visible = False
cmdOkCancel(1).Visible = False
Exit Sub
End If
If rst3.Fields("是否借出") = False Then
MsgBox "此書還沒有借出", 0 + 48, "提示"
Exit Sub
End If
rst1.Seek "=", rst2.Fields("借書證號(hào)")
rst1.Edit
'將罰款金額寫入數(shù)據(jù)庫
rst1.Fields("罰款") = Val(txtFa.Text) + rst1.Fields("罰款")
rst1.Update
If txtFa.Text > 0 Then
MsgBox "罰款金額已經(jīng)寫入數(shù)據(jù)庫!", 0 + 48, "提示"
End If
rst2.Delete
rst3.Edit
rst3.Fields("是否借出") = False
rst3.Fields("借出日期") = Empty
rst3.Update
txtBookBian1.Text = ""
txtBookBian1.SetFocus
Frame6.Visible = False
cmdOkCancel(1).Visible = False
MsgBox "還書成功!按回車?yán)^續(xù)", 0 + 48, "完畢"
End Select
End Sub
Private Sub Form_Load()
Set db2 = Workspaces(0).OpenDatabase(App.Path & "\DataBase\BookMIS.mdb", False)
Set rst2 = db2.OpenRecordset("BookFf", dbOpenTable)
rst2.Index = "圖書編號(hào)"
Set db3 = Workspaces(0).OpenDatabase(App.Path & "\DataBase\BookMIS.mdb", False)
Set rst3 = db3.OpenRecordset("Book", dbOpenTable)
rst3.Index = "圖書編號(hào)"
Set db1 = Workspaces(0).OpenDatabase(App.Path & "\DataBase\BookMIS.mdb", False)
Set rst1 = db1.OpenRecordset("Personal", dbOpenTable)
rst1.Index = "借書證號(hào)"
Set db = Workspaces(0).OpenDatabase(App.Path & "\DataBase\BookMIS.mdb", False)
Set rst = db.OpenRecordset("Type", dbOpenTable)
rst.Index = "類別"
txtBookBian1.Text = ""
txtBookhao1.Text = ""
txtBookname1.Text = ""
txtCost1 = ""
txtChuban1 = ""
txtLentDate1 = ""
txtToday = ""
txtType1 = ""
txtLentDay = ""
txtXianDing.Text = ""
txtChaoChu.Text = ""
txtFa.Text = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
rst2.Close
rst3.Close
rst1.Close
db1.Close
db2.Close
db3.Close
End Sub
Private Sub txtBookBian1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
rst3.Seek "=", txtBookBian1.Text
If rst3.NoMatch Then
MsgBox "沒有此圖書編號(hào),請(qǐng)重新填寫", 0 + 48, "填寫錯(cuò)誤"
txtBookBian1.Text = ""
'txtBookBian1.SelLength
txtBookBian1.SetFocus
Exit Sub
End If
Frame6.Visible = True
cmdOkCancel(1).Visible = True
txtBookhao1.Text = txtBookBian1.Text
txtBookname1.Text = rst3.Fields("書名") & vbNullString
txtChuban1.Text = rst3.Fields("出版社") & vbNullString
txtCost1.Text = rst3.Fields("價(jià)格") & Empty
txtLentDate1 = rst3.Fields("借出日期") & Empty
txtToday.Text = rst3.Fields("借出日期") & vbNullString
txtType1.Text = rst3.Fields("類別") & vbNullString
txtLentDay.Text = rst3.Fields("借出日期") - rst3.Fields("借出日期") & Empty
rst.Seek "=", rst3.Fields("類別")
BookDay = rst.Fields("借出天數(shù)")
txtXianDing.Text = BookDay 'BookDay 為限定借出的天數(shù)
If Val(txtLentDay.Text) - BookDay <= 0 Then '判斷是否超出了天數(shù)
txtChaoChu.Text = "未超出"
txtFa.Text = "0"
Exit Sub
Else
txtChaoChu.Text = Val(txtLentDay.Text) - BookDay
End If
'txtFa.Text = Format(FaCost * Val(txtChaoChu.Text), "#.00") '計(jì)算余額
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -