📄 modst.frm
字号:
Width = 975
End
Begin VB.Label Label1
Caption = "联系电话"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 8
Left = 4680
TabIndex = 26
Top = 2760
Width = 1095
End
Begin VB.Label Label1
Caption = "家长姓名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 9
Left = 4680
TabIndex = 25
Top = 2160
Width = 1215
End
Begin VB.Label Label1
Caption = "家庭住址"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 10
Left = 120
TabIndex = 24
Top = 4440
Width = 975
End
Begin VB.Label Label1
Caption = "备注"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 11
Left = 120
TabIndex = 23
Top = 5160
Width = 735
End
Begin VB.Label Label1
Caption = "民族"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 12
Left = 120
TabIndex = 22
Top = 2160
Width = 735
End
Begin VB.Label Label1
Caption = "班级"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 13
Left = 4680
TabIndex = 21
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "中考成绩"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 14
Left = 4680
TabIndex = 20
Top = 3360
Width = 975
End
End
End
End
Attribute VB_Name = "modst"
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
Combo3.SetFocus
End If
End Sub
Private Sub Combo3_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(Combo3.Text) Then
MsgBox "请选择团员与否 !", 48, "提示"
Combo3.SetFocus
Exit Sub
End If
If Not Testtxt(Text3.Text) Then
MsgBox "请输入出生日期 !", 48, "提示"
Text3.SetFocus
Exit Sub
End If
If Not Testtxt(Text4.Text) Then
MsgBox "请输入入校时间!", 48, "提示"
Text4.SetFocus
Exit Sub
End If
If Not Testtxt(Text5.Text) Then
MsgBox "请输入班级!", 48, "提示"
Text5.SetFocus
Exit Sub
End If
If Not Testtxt(Text6.Text) Then
MsgBox "请输入宿舍号!", 48, "提示"
Text6.SetFocus
Exit Sub
End If
If Not Testtxt(Text7.Text) Then
MsgBox "请输入家庭住址!", 48, "提示"
Text7.SetFocus
Exit Sub
End If
'=============================================
'+++++++++++++++++++++++++++++++++++++++++++++++++
txtSQL = "select * from student "
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
'Text1.Text = ""
'Text1.SetFocus
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(Combo3.Text)
dream.Fields(5) = Trim(Text3.Text)
dream.Fields(6) = Trim(Text4.Text)
dream.Fields(7) = Trim(Text5.Text)
dream.Fields(8) = Trim(Text6.Text)
dream.Fields(9) = Trim(Text7.Text)
dream.Fields(10) = Trim(Text8.Text)
dream.Fields(11) = Trim(Text9.Text)
dream.Fields(12) = Trim(Text10.Text)
dream.Fields(13) = Trim(Text11.Text)
dream.Fields(14) = Trim(Text12.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 = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Else
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo1.AddItem "男"
Combo1.AddItem "女"
Combo2.AddItem "汉族"
Combo2.AddItem "回族"
Combo2.AddItem "彝族"
Combo2.AddItem "布依族"
Combo3.AddItem "是"
Combo3.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 = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Text1.SetFocus
End Sub
Private Sub Form_Load()
Combo1.AddItem "男"
Combo1.AddItem "女"
Combo2.AddItem "汉族"
Combo2.AddItem "回族"
Combo2.AddItem "彝族"
Combo2.AddItem "布依族"
Combo3.AddItem "是"
Combo3.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 + -