?? addclasss.frm
字號:
End
Begin VB.CommandButton Command3
Caption = "第一條記錄"
Height = 615
Left = 120
TabIndex = 18
Top = 360
Width = 1455
End
End
Begin VB.Label Label6
Caption = "請 輸 入 查 詢 條 件"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 16
Top = 600
Width = 2535
End
End
Begin VB.Frame Frame1
Height = 4575
Left = 120
TabIndex = 1
Top = 360
Width = 8295
Begin VB.Frame Frame6
Height = 2295
Left = 240
TabIndex = 30
Top = 1080
Width = 6255
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Index = 2
Left = 4080
TabIndex = 38
Top = 480
Width = 1935
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Index = 0
Left = 1080
TabIndex = 35
Top = 480
Width = 1935
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Index = 3
Left = 4080
TabIndex = 34
Top = 1440
Width = 1935
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Index = 1
Left = 1080
TabIndex = 32
Top = 1440
Width = 1935
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 = 0
Left = 240
TabIndex = 37
Top = 600
Width = 1095
End
Begin VB.Label Label3
Caption = "年級"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 0
Left = 3240
TabIndex = 36
Top = 480
Width = 615
End
Begin VB.Label Label4
Caption = "教室"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 33
Top = 1440
Width = 495
End
Begin VB.Label Label7
Caption = "班主任"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 31
Top = 1560
Width = 855
End
End
Begin VB.Frame Frame2
Height = 2295
Left = 6600
TabIndex = 2
Top = 1080
Width = 1575
Begin VB.CommandButton Command2
Caption = "關閉(&C)"
Height = 615
Left = 120
TabIndex = 4
Top = 1080
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "確定(&O)"
Height = 615
Left = 120
TabIndex = 3
Top = 240
Width = 1335
End
End
End
End
End
Attribute VB_Name = "addclasss"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Command1.Caption = "確定(&O)" Then
If Not Testtxt(Text1(0).Text) Then
MsgBox "請輸入班號!", 48, "提示"
Text1(0).SetFocus
Exit Sub
End If
If Not Testtxt(Text1(1).Text) Then
MsgBox "請輸入班主任!", 48, "提示"
Text1(1).SetFocus
Exit Sub
End If
If Not Testtxt(Text1(3).Text) Then
MsgBox "請輸入教室!", 48, "提示"
Text1(2).SetFocus
Exit Sub
End If
If Not Testtxt(Text1(2).Text) Then
MsgBox "請選擇年級!", 48, "提示"
Text1(2).SetFocus
Exit Sub
End If
'+++++++++++++++++++++++++++++++++++++++++++++++++
txtSQL = "select * from class "
Set dream = ExecuteSQL(txtSQL, Msgtext)
dream.MoveFirst
While (dream.EOF = False)
If (dream.Fields(0)) = Trim(Text1(0).Text) Then
MsgBox "班號已經存在!", 48, "提示"
Text1(0).Text = " "
Text1(0).SetFocus
Exit Sub
Else
dream.MoveNext
End If
Wend
dream.AddNew
dream.Fields(0) = Trim(Text1(0).Text)
dream.Fields(1) = Trim(Text1(1).Text)
dream.Fields(2) = Trim(Text1(2).Text)
dream.Fields(3) = Trim(Text1(3).Text)
dream.UpdateBatch
'=================================================
MsgBox "添加班級成功!", 48, "提示"
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
For i = 0 To 3
Text1(i).Text = ""
Next i
Else
For i = 0 To 3
Text1(i).Text = ""
Next i
End If
End Sub
Private Sub Command2_Click()
For i = 0 To 3
Text1(i).Text = ""
Next i
End Sub
Private Sub Command3_Click()
studentmdi.StatusBar1.Panels.Item(1).Text = " "
Unload Me
End Sub
Private Sub Form_Activate()
Text1(0).SetFocus
End Sub
Private Sub Form_Load()
addclass.Height = 5535
addclass.Width = 8805
addclass.Caption = "添加班級信息[" + Format(Date, "yyyy年mm月dd日]")
studentmdi.StatusBar1.Panels.Item(1).Text = "添加班級信息"
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
'set setfocus
If KeyAscii = 13 Then
i = (Index + 1) Mod 4
Text1(i).SetFocus
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -