?? addstuinfo.frm
字號:
TextRTF = $"addStuinfo.frx":0119
End
Begin RichTextLib.RichTextBox RichTextBox1
Height = 735
Left = 1560
TabIndex = 10
Top = 2760
Width = 3375
_ExtentX = 5953
_ExtentY = 1296
_Version = 393217
TextRTF = $"addStuinfo.frx":01B6
End
Begin VB.Label Label1
Caption = "學生編號:"
Height = 375
Left = 360
TabIndex = 35
Top = 560
Width = 975
End
Begin VB.Label Label2
Caption = "學生姓名:"
Height = 375
Left = 3240
TabIndex = 34
Top = 560
Width = 1095
End
Begin VB.Label Label3
Caption = "登錄密碼:"
Height = 375
Left = 6720
TabIndex = 33
Top = 555
Width = 1095
End
Begin VB.Label Label4
Caption = "性別:"
Height = 375
Left = 360
TabIndex = 32
Top = 1130
Width = 975
End
Begin VB.Label Label5
Caption = "出生日期:"
Height = 255
Left = 3240
TabIndex = 31
Top = 1160
Width = 975
End
Begin VB.Label Label6
Caption = "入學日期:"
Height = 375
Left = 6720
TabIndex = 30
Top = 1200
Width = 1215
End
Begin VB.Label Label7
Caption = "聯系電話:"
Height = 255
Left = 6720
TabIndex = 29
Top = 2235
Width = 1215
End
Begin VB.Label Label8
Caption = "籍貫:"
Height = 375
Left = 360
TabIndex = 28
Top = 2210
Width = 975
End
Begin VB.Label Label9
Caption = "學制:"
Height = 375
Left = 360
TabIndex = 27
Top = 1720
Width = 975
End
Begin VB.Label Label10
Caption = "政治面目:"
Height = 255
Left = 3240
TabIndex = 26
Top = 1720
Width = 1335
End
Begin VB.Label Label11
Caption = "家庭住址:"
Height = 375
Left = 360
TabIndex = 25
Top = 2800
Width = 1695
End
Begin VB.Label Label14
Caption = "備注信息:"
Height = 495
Left = 360
TabIndex = 24
Top = 3600
Width = 1935
End
Begin VB.Label Label15
Caption = "民族:"
Height = 375
Left = 6720
TabIndex = 23
Top = 1725
Width = 1095
End
Begin VB.Label Label13
Caption = "培養方式:"
Height = 255
Left = 3240
TabIndex = 22
Top = 2210
Width = 1095
End
Begin VB.Label Label12
Caption = "宿舍地址:"
Height = 495
Left = 5280
TabIndex = 21
Top = 2805
Width = 1095
End
Begin VB.Label Label16
Caption = "年"
Height = 255
Left = 2520
TabIndex = 20
Top = 1720
Width = 495
End
End
Begin VB.CommandButton Command3
Caption = "保存數據(&S)"
Height = 495
Left = 4680
TabIndex = 1
Top = 5520
Width = 1335
End
Begin VB.CommandButton Command4
Caption = "返回(&B)"
Height = 495
Left = 7680
TabIndex = 0
Top = 5520
Width = 1335
End
End
Attribute VB_Name = "addStuinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public DeptID, MajorID As Integer
Private Sub Calendar1_Click()
Text4.Text = Calendar1.Value
Calendar1.Visible = False
End Sub
Private Sub Calendar2_Click()
Text5.Text = Calendar2.Value
Calendar2.Visible = False
End Sub
Private Sub Command1_Click()
Calendar1.Visible = True
End Sub
Private Sub Command2_Click()
Calendar2.Visible = True
End Sub
Private Sub Command3_Click()
Dim txtSQL As String
Dim MsgText As String
Dim MRC As ADODB.Recordset
Dim insSQL As String
Dim InsText As String
Dim INS As ADODB.Recordset
Dim ID1, ID2 As Integer
If Not (Testtxt(Text1) And Testtxt(Text2) And Testtxt(Text3) And Testtxt(Text4) And Testtxt(Text5) And Testtxt(Text6) And Testtxt(Combo1) And Testtxt(Combo2) And Testtxt(Combo3) And Testtxt(Combo4) And Testtxt(Combo5) And Testtxt(Combo6) And Testtxt(RichTextBox1) And Testtxt(RichTextBox2)) Then
MsgBox "請填寫完整學生信息!", vbOKOnly + vbExclamation, "學籍管理系統"
Exit Sub
End If
If Not IsDate(Text4) Then
MsgBox "日期的輸入的格式為(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text4.SetFocus
Text4.Text = ""
Exit Sub
End If
If Not IsDate(Text5) Then
MsgBox "日期的輸入的格式為(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
Text5.SetFocus
Text5.Text = ""
Exit Sub
End If
txtSQL = "SELECT * FROM STUDENTINFO WHERE StudentID='" & Text1.Text & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
If Not (MRC.EOF) Then
MsgBox "數據庫中已經存在學生編號為[" & Trim(Text1.Text) & "]的記錄,請查證后重新填寫!", vbOKOnly + vbExclamation, "學籍管理系統"
Text1.Text = ""
Exit Sub
End If
If (RichTextBox3.Text = "") Then
RichTextBox3.Text = " "
End If
txtSQL = "SELECT HomeTownID FROM HOMETOWN WHERE HomeTownName='" & Combo5.Text & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
ID1 = MRC.Fields(0).Value
txtSQL = "SELECT NationalityID FROM NATIONALITY WHERE NationalityName='" & Combo4.Text & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
ID2 = MRC.Fields(0).Value
insSQL = "INSERT INTO STUDENTINFO VALUES('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Combo1.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Combo2.Text & "','" & Combo3.Text & "'," & MajorID & "," & DeptID & "," & ID2 & "," & ID1 & ",'" & Combo6.Text & "','" & Text6.Text & "','" & RichTextBox1.Text & "','" & RichTextBox2.Text & "','" & RichTextBox3.Text & "')"
Set MRC = ExecuteSQL(insSQL, InsText)
Call Module1.JUDGE(InsText, addStuinfo)
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Combo5.Text = ""
Combo6.Text = ""
RichTextBox1.Text = ""
RichTextBox2.Text = ""
RichTextBox3.Text = ""
End Sub
Private Sub Command4_Click()
Unload getMajor
Unload Me
End Sub
Private Sub Form_Load()
Dim txtSQL As String
Dim MsgText As String
Dim MRC As ADODB.Recordset
Me.Move (frmMain.ScaleWidth - Me.Width) / 2, (frmMain.ScaleHeight - Me.Height) / 2
txtSQL = "SELECT MAJOR.MajorID,DEPARTMENT.DeptID FROM MAJOR,DEPARTMENT WHERE DEPARTMENT.DeptID=MAJOR.DeptID AND DEPARTMENT.DeptName='" & getMajor.Combo2.Text & "' AND MAJOR.MajorName='" & getMajor.Combo1.Text & "'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
MajorID = MRC.Fields(0).Value
DeptID = MRC.Fields(0).Value
txtSQL = "SELECT NationalityName FROM NATIONALITY"
Call Module1.DataList(txtSQL, Combo4)
txtSQL = "SELECT HomeTownName FROM HOMETOWN"
Call Module1.DataList(txtSQL, Combo5)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -