?? 管理人才信息錄入.frm
字號:
Left = 7350
TabIndex = 18
Top = 720
Width = 375
End
Begin VB.Label Label25
BackStyle = 0 'Transparent
Caption = "月"
Height = 375
Left = 8550
TabIndex = 17
Top = 720
Width = 255
End
Begin VB.Label Label26
BackStyle = 0 'Transparent
Caption = "日"
Height = 375
Left = 9570
TabIndex = 16
Top = 720
Width = 375
End
Begin VB.Line Line1
BorderColor = &H00FFFFFF&
BorderWidth = 2
X1 = 4
X2 = 1027
Y1 = 35.936
Y2 = 35.936
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "政治面貌:"
Height = 375
Left = 3780
TabIndex = 4
Top = 1530
Width = 1215
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "技術(shù)職稱:"
Height = 210
Left = 7560
TabIndex = 3
Top = 1530
Width = 1050
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "通訊地址:"
Height = 210
Left = 120
TabIndex = 2
Top = 2220
Width = 1050
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "文化程度:"
Height = 210
Left = 60
TabIndex = 1
Top = 1530
Width = 1050
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "性別:"
Height = 210
Left = 2340
TabIndex = 0
Top = 720
Width = 630
End
End
Attribute VB_Name = "管理人才信息錄入"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim t1$, t2$, t3$, t4$, t5$, t6$, t7$, t8$, t9$, t10$, t11$, t12$, t13$, t14$, c1$, c2$, c3$, c4$
Dim X1, x2, x3, x4 As Integer
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "姓名不能為空,請輸入姓名 !"
Text1.SetFocus
Else
Data1.Recordset.AddNew
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text11.Text = ""
Combo1.Text = "男"
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Text1.SetFocus
Text2.BackColor = &H80000001
Text3.BackColor = &H80000001
Text4.BackColor = &H80000001
Text5.BackColor = &H80000001
Text6.BackColor = &H80000001
Text7.BackColor = &H80000001
Text8.BackColor = &H80000001
Text9.BackColor = &H80000001
Text11.BackColor = &H80000001
Combo1.BackColor = &H80000001
Combo2.BackColor = &H80000001
Combo3.BackColor = &H80000001
Combo4.BackColor = &H80000001
End If
End Sub
Private Sub Command1_KeyPress(KeyAscii As Integer)
If Text1.Text = "" Then
MsgBox "姓名不能為空,請輸入姓名 !"
Text1.SetFocus
Else
Data1.Recordset.AddNew
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text11.Text = ""
Combo1.Text = "男"
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Text1.SetFocus
Text2.BackColor = &H80000001
Text3.BackColor = &H80000001
Text4.BackColor = &H80000001
Text5.BackColor = &H80000001
Text6.BackColor = &H80000001
Text7.BackColor = &H80000001
Text8.BackColor = &H80000001
Text9.BackColor = &H80000001
Text11.BackColor = &H80000001
Combo1.BackColor = &H80000001
Combo2.BackColor = &H80000001
Combo3.BackColor = &H80000001
Combo4.BackColor = &H80000001
End If
End Sub
Private Sub Command2_Click()
Text1.SetFocus
End Sub
Private Sub Command3_Click()
If Text1.Text = "" Then
MsgBox "姓名不能為空,請輸入姓名 !"
Text1.SetFocus
Else
Data1.Recordset.Update
Data1.Recordset.Close
Unload Me
管理人才主菜單.Show
End If
End Sub
Private Sub Command4_Click()
Data1.Recordset.Close
Unload Me
管理人才主菜單.Show
End Sub
Private Sub Form_Load()
Dim A As String
Dim B As Integer
A = Me.hwnd
B = 0
Disabled A, B
On Error GoTo W1
Data1.DatabaseName = App.Path + "\" + "人才庫.mdb"
Data1.Refresh
Data1.Recordset.AddNew
Exit Sub
W1:
Exit Sub
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t1 = Text1.Text
If t1 = "" Then
MsgBox " 請輸入姓名 "
Text1.SetFocus
Else
Combo1 = "男"
Combo1.SetFocus
Combo1.BackColor = &H80000005
End If
End If
End Sub
Private Sub Combo1_Click()
c1 = Combo1.Text
End Sub
Private Sub Combo1_Change()
c1 = Combo1.Text
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
c1 = Combo1.Text
Text2.SetFocus
Text2.BackColor = &H80000005
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t2 = Text2.Text
If t2 = "" Then
Text2.SetFocus
End If
If IsNumeric(t2) = False Then
MsgBox " 請輸入數(shù)據(jù)"
Text2.Text = ""
Text2.SetFocus
Else
Text3.SetFocus
Text3.BackColor = &H80000005
End If
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t3 = Text3.Text
If IsNumeric(t3) = False Then
MsgBox "請輸入數(shù)據(jù)"
Text3.Text = ""
Text3.SetFocus
Else
If Val(t3) < 1 Or Val(t3) > 12 Then
MsgBox "月份不能小于 1 或大于 12,請重新輸入 !"
Text3.Text = ""
Text3.SetFocus
Else
Text4.SetFocus
Text4.BackColor = &H80000005
End If
End If
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t4 = Text4.Text
If IsNumeric(t4) = False Then
MsgBox "請輸入數(shù)據(jù)"
Text4.Text = ""
Text4.SetFocus
Else
If Val(t4) < 1 Or Val(t4) > 31 Then
MsgBox "日期不能小于 1 或大于 31,請重新輸入 !"
Text4.Text = ""
Text4.SetFocus
Else
Combo2 = ""
Combo2.SetFocus
Combo2.BackColor = &H80000005
End If
End If
End If
End Sub
Private Sub Combo2_Click()
c2 = Combo2.Text
End Sub
Private Sub Combo2_Change()
c2 = Combo2.Text
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
c2 = Combo2.Text
Combo3 = ""
Combo3.SetFocus
Combo3.BackColor = &H80000005
End If
End Sub
Private Sub Combo3_Click()
c3 = Combo3.Text
End Sub
Private Sub Combo3_Change()
c3 = Combo3.Text
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
c3 = Combo3.Text
Combo4.Text = ""
Combo4.SetFocus
Combo4.BackColor = &H80000005
End If
End Sub
Private Sub Combo4_Click()
c4 = Combo4.Text
End Sub
Private Sub Combo4_Change()
c4 = Combo4.Text
End Sub
Private Sub Combo4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
c4 = Combo4.Text
Text5.Text = "五常"
Text5.SetFocus
Text5.BackColor = &H80000005
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t5 = Text5.Text
Text6.SetFocus
Text6.BackColor = &H80000005
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t6 = Text6.Text
Text7.SetFocus
Text7.BackColor = &H80000005
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t7 = Text4.Text
Text8.SetFocus
Text8.BackColor = &H80000005
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t8 = Text8.Text
Text9.SetFocus
Text9.BackColor = &H80000005
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t9 = Text9.Text
Text11.SetFocus
Text11.BackColor = &H80000005
End If
End Sub
Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
t11 = Text11.Text
Command1.SetFocus
If Len(t11) > 156 Then
MsgBox "字數(shù)太多,表格中打不下 !"
End If
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -