?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form2
BackColor = &H00C0FFC0&
Caption = "學生檔案查詢表"
ClientHeight = 5175
ClientLeft = 60
ClientTop = 450
ClientWidth = 8520
LinkTopic = "Form1"
ScaleHeight = 5175
ScaleWidth = 8520
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command1
Caption = "返 回"
Height = 375
Left = 6120
Picture = "Form1.frx":0000
Style = 1 'Graphical
TabIndex = 22
ToolTipText = "您可以返回首頁"
Top = 4080
Width = 855
End
Begin VB.CommandButton cmdquit
Caption = "退 出"
Height = 375
Index = 0
Left = 7200
Picture = "Form1.frx":09E2
Style = 1 'Graphical
TabIndex = 21
ToolTipText = "您可以退出本程序"
Top = 4080
Width = 855
End
Begin VB.CommandButton cmdfindnext
Caption = "下一個"
Height = 375
Left = 5040
Picture = "Form1.frx":2F20
Style = 1 'Graphical
TabIndex = 20
ToolTipText = "繼續查找記錄"
Top = 4080
Width = 855
End
Begin VB.CommandButton cmdfind
Caption = "查 找"
Height = 375
Left = 3840
Picture = "Form1.frx":13054
Style = 1 'Graphical
TabIndex = 19
ToolTipText = "查找您想要的記錄"
Top = 4080
Width = 855
End
Begin VB.CommandButton cmdfresh
Caption = "更 新"
Height = 375
Left = 2640
Picture = "Form1.frx":19836
Style = 1 'Graphical
TabIndex = 18
ToolTipText = "更新您的記錄"
Top = 4080
Width = 855
End
Begin VB.CommandButton cmddel
Caption = "刪 除"
Height = 375
Left = 1440
Picture = "Form1.frx":1DBFA
Style = 1 'Graphical
TabIndex = 17
ToolTipText = "刪除記錄"
Top = 4080
Width = 855
End
Begin VB.CommandButton cmdadd
Caption = "添 加"
Height = 375
Left = 240
Picture = "Form1.frx":2DD2E
Style = 1 'Graphical
TabIndex = 16
ToolTipText = "您可以添加新記錄"
Top = 4080
Width = 855
End
Begin VB.Data Data1
Caption = "學生檔案查詢"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\yyj\My Documents\李立文件管理\學生檔案查詢庫.mdb"
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
EOFAction = 2 'Add New
Exclusive = 0 'False
Height = 375
Left = 120
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "學生檔案查詢庫"
Top = 3240
Width = 7095
End
Begin VB.TextBox Text6
DataField = "聯系電話"
DataSource = "Data1"
Height = 375
Left = 1320
TabIndex = 15
Top = 2520
Width = 3495
End
Begin VB.TextBox Text5
DataField = "家庭住址"
DataSource = "Data1"
Height = 375
Left = 1320
TabIndex = 13
Top = 1800
Width = 3495
End
Begin VB.ComboBox com2
DataField = "政治面貌"
DataSource = "Data1"
Height = 300
Left = 6120
TabIndex = 11
Top = 1080
Width = 1095
End
Begin VB.TextBox Text4
DataField = "出生日期"
DataSource = "Data1"
Height = 375
Left = 3720
TabIndex = 9
Top = 1080
Width = 975
End
Begin VB.TextBox Text3
DataField = "籍貫"
DataSource = "Data1"
Height = 375
Left = 1320
TabIndex = 7
Top = 1080
Width = 975
End
Begin VB.ComboBox com1
DataField = "性別"
DataSource = "Data1"
Height = 300
Left = 6120
TabIndex = 5
Top = 360
Width = 1095
End
Begin VB.TextBox Text2
DataField = "姓名"
DataSource = "Data1"
Height = 375
Left = 3720
TabIndex = 3
Top = 360
Width = 975
End
Begin VB.TextBox Text1
DataField = "編號"
DataSource = "Data1"
Height = 375
Left = 1320
TabIndex = 1
Top = 360
Width = 975
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "聯系電話:"
Height = 375
Left = 120
TabIndex = 14
Top = 2520
Width = 1095
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "家庭住址:"
Height = 375
Left = 120
TabIndex = 12
Top = 1800
Width = 1095
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "政治面貌:"
Height = 375
Left = 5040
TabIndex = 10
Top = 1080
Width = 975
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "出生日期:"
Height = 375
Left = 2640
TabIndex = 8
Top = 1080
Width = 975
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "籍 貫:"
Height = 375
Left = 240
TabIndex = 6
Top = 1080
Width = 855
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "性 別:"
Height = 375
Left = 5160
TabIndex = 4
Top = 360
Width = 855
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "姓 名:"
Height = 375
Left = 2760
TabIndex = 2
Top = 360
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "編 號:"
Height = 375
Left = 240
TabIndex = 0
Top = 360
Width = 855
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public findstring As String
Private Sub cmdadd_Click()
cmdadd.Enabled = False
cmddel.Enabled = False
cmdfresh.Enabled = True
Data1.Recordset.AddNew
Text1.SetFocus
cmdfresh.Enabled = True
End Sub
Private Sub cmddel_Click()
If Data1.Recordset.EOF = True Then
MsgBox "這已是最后一條記錄"
Else
Data1.Recordset.Delete
If Data1.Recordset.EOF = True Then
Data1.Recordset.MoveFirst
Else
Data1.Recordset.MoveNext
End If
End If
Data1.Refresh
End Sub
Private Sub cmdEnd_Click()
End
End Sub
Private Sub cmdfind_Click()
cmdfindnext.Enabled = True
Dim temp As String
temp = InputBox$("請輸入查詢的姓名")
temp = Trim(temp) '去掉字符串首尾的空格
findstring = "姓名=" + "'" + temp + "'"
Data1.Recordset.FindFirst findstring
If Data1.Recordset.NoMatch Then
MsgBox "姓名為" + temp + "的記錄沒有找到"
End If
End Sub
Private Sub cmdfindnext_Click()
Data1.Recordset.FindNext findstring
If Data1.Recordset.NoMatch Then
MsgBox "指定的記錄已找完"
End If
cmdfindnext.Enabled = False
End Sub
Private Sub cmdfresh_Click()
Data1.UpdateRecord
Data1.Recordset.Bookmark = Data1.Recordset.LastModified
cmdadd.Enabled = True
cmddel.Enabled = True
cmdfresh.Enabled = False
End Sub
Private Sub cmdquit_Click(Index As Integer)
End
End Sub
Private Sub Command1_Click()
Form2.Hide
Form1.Show
End Sub
Private Sub Form_Load()
com1.AddItem "男"
com1.AddItem "女"
com2.AddItem "黨員"
com2.AddItem "團員"
com2.AddItem "群眾"
cmdfresh.Enabled = False
cmdfindnext.Enabled = False
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -