?? frmaddreaderinfo.frm
字號:
VERSION 5.00
Begin VB.Form frmaddreaderinfo
BackColor = &H00FFC0C0&
Caption = "添加讀者信息"
ClientHeight = 5670
ClientLeft = 60
ClientTop = 450
ClientWidth = 7320
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 5670
ScaleWidth = 7320
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Height = 975
Left = 1200
TabIndex = 17
Top = 4440
Width = 4815
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3120
TabIndex = 19
Top = 240
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 495
Left = 480
TabIndex = 18
Top = 240
Width = 1335
End
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "讀者信息"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3975
Left = 120
TabIndex = 0
Top = 240
Width = 6975
Begin VB.TextBox Text6
Height = 375
Left = 5160
TabIndex = 16
Top = 240
Width = 1335
End
Begin VB.TextBox Text5
Height = 375
Left = 5160
TabIndex = 14
Top = 1440
Width = 1335
End
Begin VB.TextBox Text4
Height = 375
Left = 1440
TabIndex = 12
Top = 2640
Width = 5055
End
Begin VB.TextBox Text3
Height = 375
Left = 1440
TabIndex = 10
Top = 2040
Width = 5055
End
Begin VB.ComboBox Combo2
Height = 300
Left = 5160
Style = 2 'Dropdown List
TabIndex = 8
Top = 840
Width = 1335
End
Begin VB.TextBox Text2
Height = 375
Left = 1440
TabIndex = 6
Top = 1440
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Left = 1440
TabIndex = 4
Top = 840
Width = 1455
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1440
Style = 2 'Dropdown List
TabIndex = 2
Top = 360
Width = 1455
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "登記日期:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 4080
TabIndex = 15
Top = 360
Width = 1050
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "電話號碼:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 4080
TabIndex = 13
Top = 1560
Width = 1050
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "家庭住址:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 11
Top = 2760
Width = 1050
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "工作單位:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 9
Top = 2160
Width = 1050
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "性 別:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 4080
TabIndex = 7
Top = 960
Width = 1050
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "讀者編號:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 5
Top = 1560
Width = 1050
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "讀者姓名:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 3
Top = 840
Width = 1050
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "讀者類別:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 360
TabIndex = 1
Top = 360
Width = 1050
End
End
End
Attribute VB_Name = "frmaddreaderinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs_addreader As New ADODB.Recordset
Private Sub Command1_Click()
Dim sql As String
If Trim(Combo1.Text) = "" Then
MsgBox "請選擇讀者種類", vbOKOnly + vbExclamation, ""
Combo1.SetFocus
Exit Sub
End If
If Trim(Text1.Text) = "" Then
MsgBox "讀者姓名不能為空", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Exit Sub
End If
If Trim(Text2.Text) = "" Then
MsgBox "讀者編號不能為空", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Exit Sub
End If
sql = "select * from 讀者信息 where 讀者編號='" & Text2.Text & "'"
rs_addreader.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_addreader.EOF Then
rs_addreader.AddNew
rs_addreader.Fields(0) = Trim(Text1.Text)
rs_addreader.Fields(1) = Trim(Text2.Text)
rs_addreader.Fields(2) = Trim(Combo2.Text)
rs_addreader.Fields(3) = Trim(Combo1.Text)
rs_addreader.Fields(4) = Trim(Text3.Text)
rs_addreader.Fields(5) = Trim(Text4.Text)
rs_addreader.Fields(6) = Trim(Text5.Text)
rs_addreader.Fields(7) = CDate(Text6.Text)
rs_addreader.Update
MsgBox "添加讀者信息成功!", vbOKOnly, ""
rs_addreader.Close
Else
MsgBox "讀者編號重復!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
rs_addreader.Close
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Combo2.AddItem "男"
Combo2.AddItem "女"
Dim rs_leibie As New ADODB.Recordset
Dim sql As String
sql = "select * from 讀者類別"
rs_leibie.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_leibie.MoveFirst
Do While Not rs_leibie.EOF
Combo1.AddItem rs_leibie.Fields(0)
rs_leibie.MoveNext
Loop
rs_leibie.Close
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -