📄 studentlixiao.frm
字号:
VERSION 5.00
Begin VB.Form studentlixiao
Caption = "学生离校注销"
ClientHeight = 4065
ClientLeft = 60
ClientTop = 450
ClientWidth = 7830
MDIChild = -1 'True
ScaleHeight = 4065
ScaleWidth = 7830
Begin VB.Frame Frame1
Height = 2775
Left = 480
TabIndex = 5
Top = 840
Width = 6855
Begin VB.TextBox Text2
Height = 375
Left = 1800
TabIndex = 2
Top = 1680
Width = 2415
End
Begin VB.TextBox Text1
Height = 375
Left = 1800
TabIndex = 1
Top = 720
Width = 2415
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 4920
TabIndex = 4
Top = 1560
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Default = -1 'True
Height = 375
Left = 4920
TabIndex = 3
Top = 720
Width = 1095
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "学生姓名:"
Height = 180
Left = 600
TabIndex = 7
Top = 1800
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "学生学号:"
Height = 180
Left = 600
TabIndex = 6
Top = 840
Width = 900
End
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "注销离校学生"
BeginProperty Font
Name = "幼圆"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2760
TabIndex = 0
Top = 240
Width = 2160
End
End
Attribute VB_Name = "studentlixiao"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public studentname As String
Public mrc As ADODB.Recordset
Private Sub Command1_Click()
Dim ok1 As String
Dim txtSQL As String
Dim MsgText As String
studenname = ""
'////////////////////////////////////
If Trim(Me.Text2.Text = "") Then
MsgBox "姓名不可为空,请输入!", vbOKOnly + vbExclamation, "警告"
Me.Text2.SetFocus
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 Trim(Me.Text1.Text = "") Then
MsgBox "学号不能为空,请重新输入学号!", vbOKOnly + vbExclamation, "警告"
Me.Text1.SetFocus
Exit Sub
Else
txtSQL = "select * from student_if where student_ID = '" & Me.Text1.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = True Then
MsgBox "没有这个学生,请重新输入学号!", vbOKOnly + vbExclamation, "警告"
Me.Text1.Text = ""
Me.Text1.SetFocus
Exit Sub
Else
If Trim(mrc.Fields(1)) = Trim(Me.Text2.Text) Then
X = MsgBox("确定要注销这个学生吗?", 35, "是否注销")
If X = 6 Then
mrc.Delete
mrc.Update
mrc.Close
Me.Text1.Text = ""
Me.Text2.Text = ""
ElseIf X = 7 Then
Me.Text1.Text = ""
Me.Text2.Text = ""
Exit Sub
ElseIf X = 2 Then
Me.Hide
End If
studentname = Trim(Me.Text1.Text)
Else
MsgBox "输入姓名不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
Me.Text2.SetFocus
Me.Text2.Text = ""
Exit Sub
End If
End If
End If
Exit Sub
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Call loading
End Sub
Private Sub loading()
Me.Height = 4575
Me.Top = 0
Me.Left = 0
Me.Width = 8000
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu mainForm1.ABC
End If
End Sub
Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu mainForm1.ABC
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -