frmupdateid.frm

来自「这是别人的数据库课程设计」· FRM 代码 · 共 101 行

FRM
101
字号
VERSION 5.00
Begin VB.Form frmUpdateID 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "确认修改学生学号"
   ClientHeight    =   1965
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3525
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   1965
   ScaleWidth      =   3525
   Begin VB.Frame Frame1 
      Caption         =   "修改学号"
      Height          =   1770
      Left            =   90
      TabIndex        =   0
      Top             =   90
      Width           =   3345
      Begin VB.CommandButton CmdQuit 
         Cancel          =   -1  'True
         Caption         =   "返回"
         Height          =   420
         Left            =   2025
         TabIndex        =   4
         Top             =   1080
         Width           =   1050
      End
      Begin VB.CommandButton CmdOK 
         Caption         =   "确认修改"
         Default         =   -1  'True
         Height          =   420
         Left            =   360
         TabIndex        =   3
         Top             =   1080
         Width           =   1050
      End
      Begin VB.TextBox txtID 
         Height          =   330
         Left            =   2025
         TabIndex        =   2
         Top             =   495
         Width           =   1005
      End
      Begin VB.Label Label1 
         Caption         =   "请输入学号:"
         Height          =   240
         Left            =   450
         TabIndex        =   1
         Top             =   540
         Width           =   1185
      End
   End
End
Attribute VB_Name = "frmUpdateID"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public sID As String
Private Sub CmdOk_Click()
Dim sCon As String
If txtID.Text = "" Then
   txtID.Text = "请输学号"
   txtID.SelStart = 0
   txtID.SelLength = Len(txtID.Text)
   txtID.SetFocus
   Exit Sub
End If
sCon = "select * from student where id='" & txtID.Text & "'"
Set adoRS = adoCon.Execute(sCon)
If adoRS.EOF Then
   MsgBox "对不起,查无此人,请执行系统查询功能," _
          & vbCrLf & vbCrLf & "确认要修改的学号后再进行修改。", _
          vbInformation + vbOKOnly, "系统提示"
   txtID.SetFocus
   
   txtID.SelStart = 0
   txtID.SelLength = Len(txtID.Text)
   Exit Sub
Else
   sID = Trim(txtID.Text)
   Unload Me
   FrmStudentUpdate.Show
End If
End Sub

Private Sub cmdQuit_Click()
Unload Me
End Sub

Private Sub Form_Load()
frmUpdateID.Move (Screen.Width - frmUpdateID.Width) / 2, (Screen.Height - frmUpdateID.Height) / 2 - 600
frmUpdateID.Show
txtID.SetFocus
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?