?? frmaddsinfo.frm
字號:
VERSION 5.00
Begin VB.Form frmAddsinfo
Caption = "添加學籍信息"
ClientHeight = 5340
ClientLeft = 45
ClientTop = 345
ClientWidth = 8625
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5340
ScaleWidth = 8625
Begin VB.CommandButton Command2
Caption = "取消添加"
Height = 372
Left = 4320
TabIndex = 19
Top = 4560
Width = 1092
End
Begin VB.CommandButton Command1
Caption = "確定添加"
Height = 372
Left = 2160
TabIndex = 18
Top = 4560
Width = 1092
End
Begin VB.TextBox txtComment
Height = 1572
Left = 1560
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 17
Top = 2640
Width = 2532
End
Begin VB.TextBox txtAddress
Height = 852
Left = 6000
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 16
Top = 2160
Width = 2172
End
Begin VB.TextBox txtRudate
Height = 372
Left = 1560
TabIndex = 15
Top = 2040
Width = 1692
End
Begin VB.TextBox txtTel
Height = 372
Left = 6000
TabIndex = 14
Top = 1560
Width = 1692
End
Begin VB.ComboBox comboClassNo
Height = 312
ItemData = "frmAddsinfo.frx":0000
Left = 1560
List = "frmAddsinfo.frx":0002
TabIndex = 13
Top = 1560
Width = 1692
End
Begin VB.TextBox txtBorndate
Height = 372
Left = 6000
TabIndex = 12
Top = 960
Width = 1692
End
Begin VB.TextBox txtName
Height = 372
Left = 6000
TabIndex = 11
Top = 360
Width = 1692
End
Begin VB.ComboBox comboSex
Height = 312
ItemData = "frmAddsinfo.frx":0004
Left = 1560
List = "frmAddsinfo.frx":0006
TabIndex = 10
Top = 960
Width = 612
End
Begin VB.TextBox txtSID
Height = 372
Left = 1560
TabIndex = 1
Top = 360
Width = 1692
End
Begin VB.Label Label9
Alignment = 2 'Center
Caption = "備注"
Height = 372
Left = 240
TabIndex = 9
Top = 2760
Width = 1092
End
Begin VB.Label Label8
Alignment = 2 'Center
Caption = "家庭住址"
Height = 252
Left = 4680
TabIndex = 8
Top = 2160
Width = 1092
End
Begin VB.Label Label7
Alignment = 2 'Center
Caption = "入校日期"
Height = 252
Left = 240
TabIndex = 7
Top = 2160
Width = 1092
End
Begin VB.Label Label6
Alignment = 2 'Center
Caption = "聯系電話"
Height = 372
Left = 4680
TabIndex = 6
Top = 1560
Width = 1092
End
Begin VB.Label Label5
Alignment = 2 'Center
Caption = "班號"
Height = 252
Left = 240
TabIndex = 5
Top = 1560
Width = 1092
End
Begin VB.Label Label4
Alignment = 2 'Center
Caption = "出生日期"
Height = 252
Left = 4680
TabIndex = 4
Top = 1080
Width = 1092
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "性別"
Height = 252
Left = 240
TabIndex = 3
Top = 960
Width = 1092
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "姓名"
Height = 252
Left = 4680
TabIndex = 2
Top = 480
Width = 1092
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "學號"
Height = 252
Left = 240
TabIndex = 0
Top = 360
Width = 1092
End
End
Attribute VB_Name = "frmAddsinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim txtSQL As String
Dim MsgText As String
Dim tmp_student As student
If Not Testtxt(txtSID.Text) Then
MsgBox "請輸入學號!", vbOKOnly + vbExclamation, "警告"
txtSID.SetFocus
Exit Sub
End If
If Not Testtxt(txtName.Text) Then
MsgBox "請輸入姓名!", vbOKOnly + vbExclamation, "警告"
txtName.SetFocus
Exit Sub
End If
If Not Testtxt(comboSex.Text) Then
MsgBox "請選擇性別!", vbOKOnly + vbExclamation, "警告"
comboSex.SetFocus
Exit Sub
End If
If Not Testtxt(txtBorndate.Text) Then
MsgBox "請輸入出生日期!", vbOKOnly + vbExclamation, "警告"
txtBorndate.SetFocus
Exit Sub
End If
If Not Testtxt(comboClassno.Text) Then
MsgBox "請選擇班號!", vbOKOnly + vbExclamation, "警告"
comboClassno.SetFocus
Exit Sub
End If
If Not Testtxt(txtTel.Text) Then
MsgBox "請輸入聯系電話!", vbOKOnly + vbExclamation, "警告"
txtTel.SetFocus
Exit Sub
End If
If Not Testtxt(txtRudate.Text) Then
MsgBox "請輸入入校日期!", vbOKOnly + vbExclamation, "警告"
txtRudate.SetFocus
Exit Sub
End If
If Not Testtxt(txtAddress.Text) Then
MsgBox "請輸入家庭住址!", vbOKOnly + vbExclamation, "警告"
txtAddress.SetFocus
Exit Sub
End If
If Not IsNumeric(Trim(txtSID.Text)) Then
MsgBox "請輸入數字!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtSID.SetFocus
End If
Set tmp_student = New student
tmp_student.student_Id = Trim(txtSID.Text)
tmp_student.query
If tmp_student.State = 1 Then 'exist duplicated student_no
If (Trim(tmp_student.student_Id) = Trim(txtSID.Text)) Then
MsgBox "學生號已經存在,請重新輸入學生號!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtSID.Text = ""
txtSID.SetFocus
End If
End If
If tmp_student.State = 2 Then 'unexisted duplicated student_no
tmp_student.student_Id = Trim(txtSID.Text)
tmp_student.student_Name = Trim(txtName.Text)
tmp_student.student_Sex = Trim(comboSex.Text)
tmp_student.born_date = Format(Trim(txtBorndate.Text), "yyyy-mm-dd")
tmp_student.class_no = Trim(comboClassno.Text)
tmp_student.tele_number = Trim(txtTel.Text)
tmp_student.ru_date = Format(Trim(txtRudate.Text), "yyyy-mm-dd")
tmp_student.address = Trim(txtAddress.Text)
tmp_student.comment = Trim(txtComment.Text)
tmp_student.insert
End If
If InStr(tmp_student.oper_flag, "insert_ok") > 0 Then
MsgBox "添加學生信息成功!", vbOKOnly + vbExclamation, "添加學生信息"
Else
MsgBox "添加學生信息失??!", vbOKOnly + vbExclamation, "添加學生信息"
End If
txtSID.Text = ""
txtName = ""
Set tmp_student = Nothing
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim coltmpclass As colclass
Dim i As Integer
comboSex.AddItem "男"
comboSex.AddItem "女"
Set coltmpclass = New colclass
coltmpclass.init
For i = 1 To coltmpclass.count
comboClassno.AddItem CStr(coltmpclass.item(i).class_no)
Next
Set coltmpclass = Nothing
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -