?? ?
字號:
VERSION 5.00
Begin VB.Form 圖書入庫1
BorderStyle = 1 'Fixed Single
Caption = "編輯圖書記錄"
ClientHeight = 3990
ClientLeft = 45
ClientTop = 435
ClientWidth = 4365
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3990
ScaleWidth = 4365
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 255
Left = 2400
TabIndex = 16
Top = 3240
Width = 855
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 255
Left = 840
TabIndex = 15
Top = 3240
Width = 855
End
Begin VB.Frame Frame1
Caption = "圖書編號"
Height = 3495
Left = 120
TabIndex = 0
Top = 240
Width = 4095
Begin VB.CommandButton Command3
Caption = "…"
Height = 255
Left = 3720
TabIndex = 17
Top = 1800
Width = 255
End
Begin VB.TextBox Text6
Height = 270
Left = 1080
TabIndex = 14
Top = 2520
Width = 975
End
Begin VB.TextBox Text5
Height = 270
Left = 1080
TabIndex = 13
Top = 2160
Width = 735
End
Begin VB.TextBox Text4
Height = 270
Left = 1080
TabIndex = 12
Top = 1440
Width = 1935
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1080
TabIndex = 11
Top = 1800
Width = 2655
End
Begin VB.TextBox Text3
Height = 270
Left = 1080
TabIndex = 10
Top = 1080
Width = 2775
End
Begin VB.TextBox Text2
Height = 270
Left = 1080
TabIndex = 9
Top = 720
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Left = 1080
TabIndex = 8
Top = 360
Width = 1095
End
Begin VB.Label Label7
Caption = "入庫日期*"
Height = 255
Left = 240
TabIndex = 7
Top = 2520
Width = 855
End
Begin VB.Label Label6
Caption = "定 價"
Height = 255
Left = 240
TabIndex = 6
Top = 2160
Width = 855
End
Begin VB.Label Label5
Caption = "出 版 社"
Height = 255
Left = 240
TabIndex = 5
Top = 1800
Width = 855
End
Begin VB.Label Label4
Caption = "作 者*"
Height = 255
Left = 240
TabIndex = 4
Top = 1440
Width = 855
End
Begin VB.Label Label3
Caption = "書 名*"
Height = 255
Left = 240
TabIndex = 3
Top = 1080
Width = 855
End
Begin VB.Label Label2
Caption = "分 類 號*"
Height = 255
Left = 240
TabIndex = 2
Top = 720
Width = 855
End
Begin VB.Label Label1
Caption = "圖書編號*"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 855
End
End
End
Attribute VB_Name = "圖書入庫1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'確定
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Or Trim(Text3.Text) = "" _
Or Trim(Text4.Text) = "" Or Trim(Text6.Text) = "" Or Trim(Combo1.Text) = "" Then
MsgBox "加*數據不能為空,請重新設置", vbOKOnly, "信息提示"
Exit Sub
End If
sqltxt = "select * from book where 圖書編號='" + _
Trim(Text1.Text) + "'" '對book中記錄進行判斷
Set rs = exesql(sqltxt)
If flag = 1 Then '添加操作,先判斷是否存在相同圖書編號的圖書
If rs.RecordCount <> 0 Then
MsgBox "存在相同的圖書編號", vbOKOnly, "信息提示"
Text1.SetFocus
rs.Close
Exit Sub
End If
rs.AddNew
rs.Fields("圖書編號") = Trim(Text1.Text)
rs.Fields("分類號") = Trim(Text2.Text)
rs.Fields("出版社") = Trim(Combo1.Text)
rs.Fields("書名") = Trim(Text3.Text)
rs.Fields("作者") = Trim(Trim(Text4.Text))
rs.Fields("定價") = Val(Trim(Text5.Text))
rs.Fields("入庫日期") = Format(Trim(Text6.Text), "yyyy-mm-dd")
rs.Fields("借否") = "否"
rs.Update
recs = recs + 1
Else '修改操作,判斷是否存在相同借書證號的讀者
rs.Fields("圖書編號") = Trim(Text1.Text)
rs.Fields("分類號") = Trim(Text2.Text)
rs.Fields("出版社") = Trim(Combo1.Text)
rs.Fields("書名") = Trim(Text3.Text)
rs.Fields("作者") = Trim(Trim(Text4.Text))
rs.Fields("定價") = Val(Trim(Text5.Text))
rs.Fields("入庫日期") = Format(Trim(Text6.Text), "yyyy-mm-dd")
rs.Update
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
xbnum = ""
End Sub
Private Sub Command3_Click()
tna = "press"
cap = "出版社"
編輯信息.Show vbModal
End Sub
Private Sub Form_Load()
Dim sqltxt As String
Dim sqltxt1 As String
Dim i As Integer
sqltxt = "select * from press "
Set rs = exesql(sqltxt)
'Combo1.Text = rs.Fields("fn")
For i = 1 To rs.RecordCount
Combo1.AddItem rs.Fields("fn")
rs.MoveNext
Next i
If flag = 2 Then '修改操作
Text1.Text = xbnum
sqltxt1 = "select * from book where 圖書編號='" + xbnum + "'"
Set brs = exesql(sqltxt1)
Text2.Text = brs.Fields("分類號")
Text3.Text = brs.Fields("書名")
Text4.Text = brs.Fields("作者")
Text5.Text = brs.Fields("定價")
Text6.Text = brs.Fields("入庫日期")
Combo1.Text = brs.Fields("出版社")
Text1.Enabled = False
Else
Text6.Text = Date '添加操作
End If
End Sub
Private Sub combo1_keypress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
Private Sub Form_Unload(Cancel As Integer)
xbnum = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -