📄 frmaddschoolinfo.frm
字号:
VERSION 5.00
Begin VB.Form frmAddschoolinfo
BorderStyle = 1 'Fixed Single
Caption = "山东大学校区信息添加"
ClientHeight = 4290
ClientLeft = 45
ClientTop = 435
ClientWidth = 5700
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4290
ScaleWidth = 5700
Begin VB.CommandButton cmdOK
Caption = "确定(&O)"
Height = 375
Left = 480
TabIndex = 5
Top = 3720
Width = 975
End
Begin VB.CommandButton cmdRefresh
Caption = "刷新(&R)"
Height = 375
Left = 2400
TabIndex = 4
Top = 3720
Width = 975
End
Begin VB.CommandButton cmdCancel
Caption = "取消(&X)"
Height = 375
Left = 4200
TabIndex = 3
Top = 3720
Width = 975
End
Begin VB.TextBox txtSchooldes
Height = 1215
Left = 1800
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Top = 2040
Width = 2655
End
Begin VB.TextBox txtSchoolname
Height = 375
Left = 1800
TabIndex = 1
Top = 1320
Width = 2655
End
Begin VB.TextBox txtSchoolno
Height = 375
Left = 1800
TabIndex = 0
Top = 600
Width = 2655
End
Begin VB.Frame Frame1
Caption = "校区信息"
Height = 3375
Left = 480
TabIndex = 6
Top = 120
Width = 4695
Begin VB.Label Label1
Caption = "校区号"
Height = 375
Left = 360
TabIndex = 9
Top = 600
Width = 1215
End
Begin VB.Label Label2
Caption = "校区名"
Height = 495
Left = 360
TabIndex = 8
Top = 1320
Width = 1215
End
Begin VB.Label Label3
Caption = "校区地址"
Height = 375
Left = 360
TabIndex = 7
Top = 2040
Width = 1095
End
End
End
Attribute VB_Name = "frmAddschoolinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdOK_Click()
Dim mrc As ADODB.Recordset
Dim MsgText As String
Dim txtSQL As String
If Not Testtxt(txtSchoolno.Text) Then
MsgBox "请输入校区编号!", vbOKOnly + vbExclamation, "提示"
txtSchoolno.SetFocus
Exit Sub
End If
If Not Testtxt(txtSchoolname.Text) Then
MsgBox "请输入校区名称!", vbOKOnly + vbExclamation, "提示"
txtSchoolname.SetFocus
Exit Sub
End If
If Not Testtxt(txtSchooldes.Text) Then
MsgBox "请输入校区描述信息!", vbOKOnly + vbExclamation, "提示"
txtSchooldes.SetFocus
Exit Sub
End If
If Not IsNumeric(Trim(txtSchoolno.Text)) Then
MsgBox "请输入数字编号!", vbOKOnly + vbExclamation, "提示"
Exit Sub
txtSchoolno.SetFocus
End If
txtSQL = "select * from School_Info "
Set mrc = ExecuteSQL(txtSQL, MsgText)
While (mrc.EOF = False)
If (Trim(mrc.Fields(0)) = Trim(txtSchoolno.Text)) Then
MsgBox "校区编号已经存在,请重新输入校区编号!", vbOKOnly + vbExclamation, "提示"
txtSchoolno.Text = ""
txtSchoolno.SetFocus
Exit Sub
Else
mrc.MoveNext
End If
Wend
mrc.AddNew
mrc.Fields(0) = Trim(txtSchoolno.Text)
mrc.Fields(1) = Trim(txtSchoolname.Text)
mrc.Fields(2) = Trim(txtSchooldes.Text)
mrc.Update
mrc.Close
MsgBox "添加校区信息成功!", vbOKOnly + vbExclamation, "添加校区信息"
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdRefresh_Click()
txtSchoolno.Text = ""
txtSchoolname.Text = ""
txtSchooldes.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -