📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form addstudgo
Caption = "Form1"
ClientHeight = 6120
ClientLeft = 60
ClientTop = 345
ClientWidth = 8865
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 6120
ScaleWidth = 8865
Begin VB.CommandButton Command4
Caption = "关 闭"
Height = 495
Left = 5520
TabIndex = 21
Top = 4920
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "取 消"
Height = 495
Left = 4080
TabIndex = 20
Top = 4920
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "查 询"
Height = 495
Left = 2640
TabIndex = 19
Top = 4920
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确 定"
Height = 495
Left = 1200
TabIndex = 18
Top = 4920
Width = 1215
End
Begin VB.TextBox Text7
Height = 2055
Left = 1080
TabIndex = 17
Top = 2640
Width = 6975
End
Begin VB.ComboBox Combo2
Height = 300
Left = 5520
TabIndex = 16
Top = 240
Width = 2535
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1080
TabIndex = 15
Top = 1440
Width = 2295
End
Begin VB.TextBox Text6
Height = 495
Left = 5520
TabIndex = 14
Top = 1920
Width = 2535
End
Begin VB.TextBox Text5
Height = 495
Left = 5520
TabIndex = 13
Top = 1320
Width = 2535
End
Begin VB.TextBox Text4
Height = 495
Left = 5520
TabIndex = 12
Top = 720
Width = 2535
End
Begin VB.TextBox Text3
Height = 495
Left = 1080
TabIndex = 11
Top = 1920
Width = 2295
End
Begin VB.TextBox Text2
Height = 495
Left = 1080
TabIndex = 10
Top = 840
Width = 2295
End
Begin VB.TextBox Text1
Height = 495
Left = 1080
TabIndex = 9
Top = 240
Width = 2295
End
Begin VB.Label Label9
Caption = "备注"
Height = 495
Left = 240
TabIndex = 8
Top = 2520
Width = 1215
End
Begin VB.Label Label8
Caption = "高考成绩"
Height = 495
Left = 4080
TabIndex = 7
Top = 1920
Width = 1215
End
Begin VB.Label Label7
Caption = "录取院校及专业"
Height = 495
Left = 4080
TabIndex = 6
Top = 1320
Width = 1335
End
Begin VB.Label Label6
Caption = "录取时间"
Height = 495
Left = 4080
TabIndex = 5
Top = 720
Width = 1215
End
Begin VB.Label Label5
Caption = "应届与否"
Height = 495
Left = 4080
TabIndex = 4
Top = 240
Width = 1215
End
Begin VB.Label Label4
Caption = "班级"
Height = 495
Left = 240
TabIndex = 3
Top = 1920
Width = 1215
End
Begin VB.Label Label3
Caption = "性别"
Height = 495
Left = 240
TabIndex = 2
Top = 1320
Width = 1215
End
Begin VB.Label Label2
Caption = "姓名"
Height = 495
Left = 240
TabIndex = 1
Top = 840
Width = 1215
End
Begin VB.Label Label1
Caption = "编号"
Height = 495
Left = 240
TabIndex = 0
Top = 240
Width = 1215
End
End
Attribute VB_Name = "addstudgo"
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
Text3.SetFocus
End If
End Sub
Private Sub Combo2_Change()
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 = "确 定" 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(Text3.Text) Then
MsgBox "请输入班级!", 48, "提示"
Text3.SetFocus
Exit Sub
End If
If Not Testtxt(Combo2.Text) Then
MsgBox "请选择应届与否!", 48, "提示"
Combo2.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
'+++++++++++++++++++++++++++++++++++++++++++++++++
txtSQL = "select * from studentgo "
Set dream = ExecuteSQL(txtSQL, Msgtext)
dream.MoveFirst
While (dream.EOF = False)
If (dream.Fields(0)) = Trim(Text1.Text) Then
MsgBox "编号已经存在!", 48, "提示"
Text1.Text = " "
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(Text3.Text)
dream.Fields(4) = Trim(Combo2.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.UpdateBatch
MsgBox "添加学生录取信息成功!", 48, "提示"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Else
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Combo1.Text = ""
Combo2.Text = ""
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
addstudgo.Width = 8985
addstudgo.Height = 6525
Combo1.AddItem "男"
Combo1.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 Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo1.SetFocus
End If
End Sub
Private Sub Text3_Change()
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo2.SetFocus
End If
End Sub
Private Sub Text4_Change()
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -