📄 form4.frm
字号:
VERSION 5.00
Begin VB.Form Form4
Caption = "添加新项目"
ClientHeight = 3435
ClientLeft = 60
ClientTop = 450
ClientWidth = 5085
LinkTopic = "Form4"
ScaleHeight = 3435
ScaleWidth = 5085
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "添加项目"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2895
Left = 240
TabIndex = 0
Top = 120
Width = 4575
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2520
TabIndex = 4
Top = 2040
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "添加"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 3
Top = 2040
Width = 1695
End
Begin VB.TextBox Text1
Height = 495
Left = 1680
TabIndex = 2
Top = 600
Width = 2655
End
Begin VB.Label Label1
Caption = "项目名称"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 1
Top = 720
Width = 1455
End
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo ErrMsg
Dim sql As String
Dim sql1 As String
Dim sql2 As String
If Text1.Text = "" Then
MsgBox "请您输入运动项目名!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If
sql2 = "insert into 运动项目表4119 values('" & Text1.Text & "')"
adocon.Execute (sql2)
sql = "alter table 运动项目及参赛表m4119 add " & Text1.Text & " varchar(20) NULL"
adocon.Execute (sql)
sql1 = "alter table 运动项目及成绩表m4119 add " & Text1.Text & " varchar(20) NULL"
adocon.Execute (sql1)
MsgBox "您已成功添加" + Text1.Text + "项目!", vbOKOnly + vbInformation, "系统提示"
ErrMsg:
If Err.Number <> 0 Then
MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Unload Me
'MDIForm1.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -