📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
Caption = "运动员添加"
ClientHeight = 4455
ClientLeft = 60
ClientTop = 450
ClientWidth = 6525
LinkTopic = "Form3"
ScaleHeight = 4455
ScaleWidth = 6525
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 = 4335
Left = 0
TabIndex = 0
Top = 0
Width = 6495
Begin VB.ComboBox Combo1
Height = 300
Left = 600
Style = 2 'Dropdown List
TabIndex = 15
Top = 1560
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4560
TabIndex = 14
Top = 3480
Width = 1575
End
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 = 13
Top = 3480
Width = 1575
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 = 12
Top = 3480
Width = 1575
End
Begin VB.ListBox List1
Height = 2760
Left = 4080
TabIndex = 10
Top = 360
Width = 1935
End
Begin VB.TextBox Text5
Height = 270
Left = 1080
TabIndex = 9
Top = 2880
Width = 1095
End
Begin VB.TextBox Text4
Height = 270
Left = 600
TabIndex = 8
Top = 2160
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Left = 600
TabIndex = 7
Top = 960
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Left = 600
TabIndex = 6
Top = 360
Width = 1095
End
Begin VB.Label Label6
Caption = "主参赛项目"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2760
TabIndex = 11
Top = 720
Width = 1095
End
Begin VB.Label Label5
Caption = "所在队号"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 5
Top = 2880
Width = 975
End
Begin VB.Label Label4
Caption = "年龄"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 4
Top = 2160
Width = 975
End
Begin VB.Label Label3
Caption = "性别"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 3
Top = 1560
Width = 975
End
Begin VB.Label Label2
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 2
Top = 960
Width = 975
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 = 255
Left = 120
TabIndex = 1
Top = 360
Width = 975
End
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strtmp As String
Private Sub Command1_Click()
On Error GoTo ErrMsg
Dim sql As String
Dim sql1 As String
If Text1.Text = "" Or Text2.Text = "" Or Combo1.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or List1.Text = "" Then
MsgBox "请您添好数据!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If
'If Text3.Text <> 男 Or Text3.Text <> 女 Then
'MsgBox "性别只能输入男女!", vbOKOnly + vbExclamation, "系统提示"
'Exit Sub
'End If
Set adors = adocon.Execute("select a_noteam4119 from 运动队4119 where " & Text5.Text & "=a_noteam4119")
If adors.EOF Then
MsgBox "队号不对,请您从新确认队号!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If
sql = "Insert Into 运动项目及参赛表m4119(a_no4119," & strtmp & ")" & _
" Values(" & Text1.Text & ",'1 ')"
adocon.Execute (sql)
sql1 = "Insert Into 运动员4119 Values(" & Text1.Text & ",'" & Text2.Text & "','" & Combo1.Text & "'," & Text4.Text & "," & Text5.Text & ")"
adocon.Execute (sql1)
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 = ""
Text2.Text = ""
'Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
'MDIForm1.Show
End Sub
Private Sub Form_Load()
On Error GoTo ErrMsg
Dim sql As String
sql = "select i_name4119 from 运动项目表4119"
Set adors = adocon.Execute(sql)
Do While adors.EOF = False
List1.AddItem adors(0)
adors.MoveNext
Loop
Combo1.AddItem "男"
Combo1.AddItem "女"
ErrMsg:
If Err.Number <> 0 Then
MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
Exit Sub
End If
End Sub
Private Sub List1_Click()
'Dim i As Integer
'For i = 0 To List1.ListCount - 1
'If List1.Selected(i) = True Then strtmp = strtmp & List1.Text(i)
'Next i
strtmp = List1.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -