📄 addleague.frm
字号:
End
Begin VB.Label Label6
Caption = "班级"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4680
TabIndex = 19
Top = 1080
Width = 1215
End
Begin VB.Label Label7
Caption = "出生日期"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4680
TabIndex = 18
Top = 1680
Width = 1215
End
Begin VB.Label Label8
Caption = "入团日期"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4680
TabIndex = 17
Top = 2280
Width = 1215
End
Begin VB.Label Label9
Caption = "家庭住址"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 16
Top = 3000
Width = 1095
End
Begin VB.Label Label10
Caption = "备注"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 15
Top = 3720
Width = 975
End
End
Begin VB.CommandButton Command3
Caption = "关闭(&C)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 10080
TabIndex = 3
Top = 1800
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "重填(&E)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 10080
TabIndex = 2
Top = 1080
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定(&O)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 10080
TabIndex = 1
Top = 360
Width = 1215
End
Begin VB.Frame Frame1
Height = 2535
Left = 9840
TabIndex = 0
Top = 120
Width = 1695
End
End
Attribute VB_Name = "addleague"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo2.SetFocus
End If
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If
End Sub
Private Sub Command1_Click()
If Command1.Caption = "确定(&O)" Then
If Not Testtxt(Text1.Text) Then
MsgBox "请输入编号!", 48, "提示"
Text1.SetFocus
Exit Sub
End If
If Not Testtxt(Text2.Text) Then
MsgBox "请输入姓名!", 48, "提示"
Text2.SetFocus
Exit Sub
End If
If Not Testtxt(Combo1.Text) Then
MsgBox "请选择性别!", 48, "提示"
Combo1.SetFocus
Exit Sub
End If
If Not Testtxt(Combo2.Text) Then
MsgBox "请选择民族!", 48, "提示"
Combo2.SetFocus
Exit Sub
End If
If Not Testtxt(Text5.Text) Then
MsgBox "请输入出生日期 !", 48, "提示"
Text3.SetFocus
Exit Sub
End If
If Not Testtxt(Text6.Text) Then
MsgBox "请输入入团日期!", 48, "提示"
Text6.SetFocus
Exit Sub
End If
If Not Testtxt(Text4.Text) Then
MsgBox "请输入班级!", 48, "提示"
Text5.SetFocus
Exit Sub
End If
If Not Testtxt(Text3.Text) Then
MsgBox "请输入籍贯!", 48, "提示"
Text3.SetFocus
Exit Sub
End If
If Not Testtxt(Text7.Text) Then
MsgBox "请输入家庭住址!", 48, "提示"
Text7.SetFocus
Exit Sub
End If
'=============================================
'+++++++++++++++++++++++++++++++++++++++++++++++++
txtSQL = "select * from league "
Set dream = ExecuteSQL(txtSQL, Msgtext)
dream.MoveFirst
'number exist ?
While (dream.EOF = False)
If (dream.Fields(0)) = Trim(Text1.Text) Then
MsgBox "编号已经存在!", 48, "提示"
Text1.SetFocus
Exit Sub
Else
dream.MoveNext
End If
Wend
dream.AddNew
dream.Fields(0) = Trim(Text1.Text)
dream.Fields(1) = Trim(Text2.Text)
dream.Fields(2) = Trim(Combo1.Text)
dream.Fields(3) = Trim(Combo2.Text)
dream.Fields(4) = Trim(Text3.Text)
dream.Fields(5) = Trim(Text4.Text)
dream.Fields(6) = Trim(Text5.Text)
dream.Fields(7) = Trim(Text6.Text)
dream.Fields(8) = Trim(Text7.Text)
dream.Fields(9) = Trim(Text8.Text)
dream.UpdateBatch
'=================================================
MsgBox "添加团员信息成功!", 48, "提示"
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Else
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo1.AddItem "男"
Combo1.AddItem "女"
Combo2.AddItem "汉族"
Combo2.AddItem "回族"
Combo2.AddItem "彝族"
Combo2.AddItem "布依族"
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo2.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Calendar1.Visible = True
End Sub
Private Sub Calendar1_Click()
Text5.Text = Calendar1.Value
Calendar1.Visible = False
End Sub
Private Sub Command5_Click()
Calendar2.Visible = True
End Sub
Private Sub Calendar2_Click()
Text6.Text = Calendar1.Value
Calendar2.Visible = False
End Sub
Private Sub Form_Activate()
Text1.SetFocus
End Sub
Private Sub Form_Load()
Calendar1.Visible = False
Calendar2.Visible = False
addleague.Height = 6660
addleague.Width = 11730
Combo1.AddItem "男"
Combo1.AddItem "女"
Combo2.AddItem "汉族"
Combo2.AddItem "回族"
Combo2.AddItem "彝族"
Combo2.AddItem "布依族"
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text11.SetFocus
End If
End Sub
Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text12.SetFocus
End If
End Sub
Private Sub Text12_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Command1_Click
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo1.SetFocus
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.SetFocus
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.SetFocus
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text7.SetFocus
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text8.SetFocus
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text9.SetFocus
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text10.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -