?? frmupdatebook.frm
字號:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FrmUpdateBook
Caption = "正在修改圖書"
ClientHeight = 4275
ClientLeft = 60
ClientTop = 345
ClientWidth = 8775
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4275
ScaleWidth = 8775
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdClose
Caption = "退出"
Height = 495
Left = 6840
TabIndex = 18
Top = 3600
Width = 1335
End
Begin VB.CommandButton cmdSave
Caption = "保存"
Height = 495
Left = 5400
TabIndex = 17
Top = 3600
Width = 1335
End
Begin VB.Frame Frame1
Caption = "書籍信息"
Height = 3255
Left = 0
TabIndex = 0
Top = 120
Width = 8535
Begin MSComCtl2.DTPicker dtpRigDate
Height = 375
Left = 5040
TabIndex = 16
Top = 1560
Width = 3135
_ExtentX = 5530
_ExtentY = 661
_Version = 393216
Format = 75956225
CurrentDate = 37828
End
Begin VB.TextBox txtWriter
Height = 375
Left = 960
TabIndex = 14
Top = 1560
Width = 3015
End
Begin VB.TextBox txtBookConcern
Height = 375
Left = 5040
TabIndex = 11
Top = 960
Width = 3375
End
Begin VB.TextBox txtPage
Height = 375
Left = 960
TabIndex = 9
Top = 2160
Width = 3015
End
Begin VB.TextBox txtPrice
Height = 375
Left = 5040
TabIndex = 8
Top = 2160
Width = 3255
End
Begin VB.ComboBox cboType
Height = 300
Left = 960
TabIndex = 6
Top = 960
Width = 3015
End
Begin VB.TextBox txtBookName
Height = 375
Left = 5040
TabIndex = 3
Top = 360
Width = 3375
End
Begin VB.TextBox txtBookID
BackColor = &H00FFFFFF&
Enabled = 0 'False
Height = 375
Left = 960
TabIndex = 1
Top = 360
Width = 3015
End
Begin VB.Label Label3
Caption = "登記日期:"
Height = 255
Left = 4200
TabIndex = 15
Top = 1680
Width = 855
End
Begin VB.Label Label2
Caption = "作者姓名:"
Height = 375
Left = 120
TabIndex = 13
Top = 1680
Width = 855
End
Begin VB.Label Label1
Caption = "出版社:"
Height = 255
Left = 4320
TabIndex = 12
Top = 1080
Width = 735
End
Begin VB.Label Label22
Caption = "書籍頁碼:"
Height = 255
Left = 120
TabIndex = 10
Top = 2280
Width = 855
End
Begin VB.Label Label26
Caption = "書籍價格:"
Height = 255
Left = 4200
TabIndex = 7
Top = 2280
Width = 855
End
Begin VB.Label Label24
Caption = "書籍類別:"
Height = 255
Left = 120
TabIndex = 5
Top = 1080
Width = 855
End
Begin VB.Label Label25
Caption = "書籍名稱:"
Height = 255
Left = 4080
TabIndex = 4
Top = 480
Width = 975
End
Begin VB.Label Label27
Caption = "書籍編號:"
Height = 255
Left = 120
TabIndex = 2
Top = 480
Width = 975
End
End
End
Attribute VB_Name = "FrmUpdateBook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClose_Click()
FrmBookManage.Adodc1.Refresh
Unload Me
End Sub
Private Sub cmdSave_Click()
g_strSql = "select * from bookInfo where 書籍編號='" & txtBookID.Text & "'"
Set g_rs = g_db.OpenRecordset(g_strSql)
g_rs.Edit
'設置記錄的字段值
g_rs!書籍名稱 = txtBookName.Text
g_rs!類別代碼 = Mid(cboType.Text, 1, 1)
g_rs!出版社 = txtBookConcern.Text
g_rs!作者姓名 = txtWriter.Text
g_rs!書籍價格 = txtPrice.Text
g_rs!書籍頁碼 = txtPage.Text
g_rs!登記日期 = dtpRigDate.Value
g_rs!是否借出 = False
' 保存修改!!!
g_rs.Update
Set g_rs = Nothing
MsgBox "保存修改完畢!", vbOKOnly, "提示"
FrmBookManage.Adodc1.Refresh
Unload Me
End Sub
Private Sub Form_Load()
dtpRigDate.Value = Date
Set g_rs = g_db.OpenRecordset("bookType", dbOpenTable)
cboType.Clear
If g_rs.RecordCount > 0 Then
g_rs.MoveFirst
Do While Not g_rs.EOF
cboType.AddItem g_rs!類別代碼 + "-" + g_rs!書籍類別
g_rs.MoveNext
Loop
End If
Set g_rs = Nothing
FrmBookManage.DataGrid1.Col = 0
txtBookID.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 1
txtBookName.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 2
cboType.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 3
txtBookConcern.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 4
txtWriter.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 5
txtPrice.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 6
txtPage.Text = FrmBookManage.DataGrid1.Text
FrmBookManage.DataGrid1.Col = 7
dtpRigDate.Value = FrmBookManage.DataGrid1.Text
Set g_rs = g_db.OpenRecordset("bookType", dbOpenTable)
If g_rs.RecordCount > 0 Then
g_rs.MoveFirst
Do While Not g_rs.EOF
If cboType.Text = g_rs!書籍類別 Then
cboType.Text = g_rs!類別代碼 + "-" + g_rs!書籍類別
End If
g_rs.MoveNext
Loop
End If
Set g_rs = Nothing
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -