?? xinxueqi.frm
字號:
Left = 3480
TabIndex = 19
Top = 4440
Width = 210
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "寢室費用:"
Height = 180
Left = 360
TabIndex = 18
Top = 4320
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "寢 室 號:"
Height = 180
Left = 360
TabIndex = 17
Top = 3120
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "居住樓號:"
Height = 180
Left = 4200
TabIndex = 16
Top = 2040
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "姓 名:"
Height = 180
Left = 4320
TabIndex = 15
Top = 840
Width = 810
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "學 號:"
Height = 180
Left = 480
TabIndex = 14
Top = 840
Width = 810
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "季 度:"
Height = 180
Left = 4200
TabIndex = 13
Top = 3120
Width = 810
End
End
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "新學期注冊"
BeginProperty Font
Name = "幼圓"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 5160
TabIndex = 1
Top = 120
Width = 2250
End
End
Attribute VB_Name = "xinxueqi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo4_Click()
Me.MonthView1.Visible = True
End Sub
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
'判斷各個輸入框中是否為空
If Me.Text1.Text = "" Then
MsgBox "請輸入學號!", vbOKOnly + vbExclamation, "警告"
Me.Text1.SetFocus
Me.Text1.Text = ""
Exit Sub
End If
If Not IsNumeric(Trim(Me.Text1.Text)) Then
MsgBox "學號必須為數字型!,請重新輸入!", vbOKOnly + vbExclamation, "警告"
Me.Text1.Text = ""
Me.Text1.SetFocus
Exit Sub
End If
If Me.Text2.Text = "" Then
MsgBox "請輸入姓名!", vbOKOnly + vbExclamation, "警告"
Me.Text2.SetFocus
Exit Sub
End If
If Me.Combo1.Text = "" Then
MsgBox "您沒有選擇性別!", vbOKOnly + vbExclamation, "警告"
Me.Combo1.SetFocus
Exit Sub
End If
If Trim(Me.Text3.Text = "") Then
MsgBox "居住號不可為空!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Me.Text4.Text = "") Then
MsgBox "寢室號不可為空!", vbOKOnly + vbExclamation, "警告"
Me.Text4.SetFocus
Exit Sub
End If
If Me.Combo2.Text = "" Then
MsgBox "請選擇費用類型!", vbOKOnly + vbExclamation, "警告"
Me.Combo2.SetFocus
Exit Sub
End If
If Me.Combo2.Text = "" Then
MsgBox "請選擇交費情況!", vbOKOnly + vbExclamation, "警告"
Me.Combo3.SetFocus
Exit Sub
End If
If Me.Text5.Text = "" Then
MsgBox "請輸入注冊的季度!", vbOKOnly + vbExclamation, "警告"
Me.Text5.SetFocus
Exit Sub
End If
If Me.Text6.Text = "" Then
MsgBox "請選擇注冊日期!", vbOKOnly + vbExclamation, "警告"
Me.Text6.SetFocus
Exit Sub
End If
'首先查詢學生表中是否有學號的學生
txtSQL = "select student_ID from student_if where student_ID = '" & Trim(Me.Text1.Text) & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = False Then
'如果學生表中沒有這個學生,則還要再次查詢新學生注冊表中是否有相同的學生號
'開始查詢數據庫里的學生的學號是否重復
txtSQL = "select student_ID from xin_zc where student_ID = '" & Trim(Me.Text1.Text) & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = False Then
MsgBox "這個學號已經有了,請重新輸入!", vbOKOnly + vbExclamation, "警告"
mrc.Close
Me.Text1.Text = ""
Me.Text1.SetFocus
Else
mrc.Close
txtSQL = "select * from xin_zc"
Set mrc = ExecuteSQL(txtSQL, MsgText)
mrc.AddNew '添加一條記錄
mrc.Fields(0) = Trim(Me.Text1.Text)
mrc.Fields(1) = Trim(Me.Text2.Text)
mrc.Fields(2) = Trim(Me.Combo1.Text)
mrc.Fields(3) = Trim(Me.Text3.Text)
mrc.Fields(4) = Trim(Me.Text4.Text)
mrc.Fields(5) = Trim(Me.Text5.Text)
mrc.Fields(6) = Trim(Me.Combo2.Text)
mrc.Fields(7) = Trim(Me.Combo3.Text)
mrc.Fields(8) = Trim(Me.Text6.Text)
mrc.Fields(9) = Trim(Me.Text7.Text)
mrc.Update
mrc.Close
MsgBox "新注冊的信息成功!", vbOKOnly + vbExclamation, "提示"
Me.Text1.Text = ""
Me.Text2.Text = ""
Me.Combo1.Text = ""
Me.Text3.Text = ""
Me.Text4.Text = ""
Me.Text5.Text = ""
Me.Combo2.Text = ""
Me.Combo3.Text = ""
Me.Text6.Text = ""
Me.Text7.Text = ""
End If
Else
MsgBox "不存在這個學號,請重新輸入!", vbOKOnly + vbExclamation, "警告"
mrc.Close
Exit Sub
End If
End Sub
Private Sub loading()
Me.Top = 0
Me.Width = 13900
Me.Height = 9500
Me.Left = 0
Me.Combo2.Text = "900"
Me.Combo3.AddItem "已交"
Me.Combo3.AddItem "未交"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Call loading
End Sub
Private Sub MonthView1_DateDblClick(ByVal DateDblClicked As Date)
Me.Text6.Text = Me.MonthView1.Year & "-" & Me.MonthView1.Month & "-" & Me.MonthView1.Day
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -