📄 edit_main.frm
字号:
Left = 240
TabIndex = 12
Top = 720
Width = 855
End
End
Begin VB.Data datStands
BackColor = &H00FFFFFF&
Connect = "Access"
DatabaseName = "tennis.mdb"
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
ForeColor = &H00000000&
Height = 375
Left = -74520
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "Stands"
Top = 4800
Width = 4455
End
Begin VB.Frame fraStands
Caption = "Stands Details"
Enabled = 0 'False
Height = 3615
Left = -74640
TabIndex = 5
Top = 840
Width = 5535
Begin VB.TextBox txtStands
BackColor = &H00000000&
DataField = "Nom"
DataSource = "datStands"
ForeColor = &H00FFFFFF&
Height = 285
Left = 1080
TabIndex = 7
Top = 720
Width = 2040
End
Begin VB.TextBox txtType
BackColor = &H00000000&
DataField = "Type"
DataSource = "datStands"
ForeColor = &H00FFFFFF&
Height = 285
Left = 1080
TabIndex = 6
Top = 1320
Width = 2040
End
Begin VB.Label lblType
Caption = "Description:"
Height = 240
Left = 240
TabIndex = 9
Top = 1320
Width = 915
End
Begin VB.Label lblStands
Caption = "Name :"
Height = 165
Left = 240
TabIndex = 8
Top = 720
Width = 585
End
End
Begin VB.Image Image2
Height = 480
Left = 6660
Picture = "Edit_main.frx":08B3
Top = 4500
Width = 480
End
Begin VB.Label Label9
Alignment = 2 'Center
Caption = "Re&fresh"
Height = 255
Left = 6360
TabIndex = 30
Top = 4980
Width = 1095
End
Begin VB.Label Label8
Alignment = 2 'Center
Caption = "Re&fresh"
Height = 255
Left = -68640
TabIndex = 29
Top = 4980
Width = 1095
End
Begin VB.Image Image1
Height = 480
Left = -68340
Picture = "Edit_main.frx":14F5
Top = 4500
Width = 480
End
Begin VB.Shape Shape2
BorderColor = &H00E0E0E0&
BorderWidth = 10
Height = 4740
Index = 1
Left = 240
Top = 600
Width = 7365
End
Begin VB.Shape Shape2
BorderColor = &H00E0E0E0&
BorderWidth = 10
Height = 4740
Index = 0
Left = -74760
Top = 600
Width = 7365
End
End
Begin VB.Label Label1
Caption = "Label1"
Height = 540
Left = 3375
TabIndex = 2
Top = 2670
Width = 1215
End
End
Attribute VB_Name = "EditMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
fraStands.Enabled = False
FraParticipant.Enabled = False
DatStands.Recordset.CancelUpdate
DatParticipant.Recordset.CancelUpdate
cmdSave.Visible = False
cmdCancel.Visible = False
anmSearch.Visible = False
End Sub
Private Sub cmdCancel_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
cmdCancel.FontBold = True
cmdSave.FontBold = False
End Sub
Private Sub cmdSave_Click()
If fraStands.Enabled = True Then
'stands edit mode is active
DatStands.Recordset.Edit
DatStands.Recordset.Update
fraStands.Enabled = False
Else
'particip edit mode is active
Call Modife_player
FraParticipant.Enabled = False
End If
cmdSave.Visible = False
cmdCancel.Visible = False
anmSearch.Visible = False
End Sub
Private Sub cmdSave_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
cmdSave.FontBold = True
cmdCancel.FontBold = False
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.FontBold = True
End Sub
'caption
Private Sub datParticipant_Reposition()
Timer1.Enabled = False
DatParticipant.Caption = "Player " & DatParticipant.Recordset.AbsolutePosition + 1 & _
" of " & DatParticipant.Recordset.RecordCount
End Sub
'catpion
Private Sub datStands_Reposition()
Timer1.Enabled = False
DatStands.Caption = "Stand " & DatStands.Recordset.AbsolutePosition + 1 & _
" of " & DatStands.Recordset.RecordCount
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
DatParticipant.Refresh
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call menu_change
Timer1.Enabled = False
End Sub
Private Sub Image1_Click()
DatParticipant.Refresh
DatStands.Refresh
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label8.FontBold = True
End Sub
Private Sub Image2_Click()
DatParticipant.Refresh
DatStands.Refresh
End Sub
Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label9.FontBold = True
End Sub
Private Sub Label8_Click()
DatParticipant.Refresh
DatStands.Refresh
End Sub
Private Sub Label8_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label8.FontBold = True
End Sub
Private Sub Label9_Click()
DatParticipant.Refresh
DatStands.Refresh
End Sub
Private Sub Label9_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label9.FontBold = True
End Sub
Private Sub mnuFileAdd_Click()
If tabGeneral.Tab = 0 Then
add_player.Show
Else
Add_stands.Show
End If
End Sub
Private Sub mnuFileAdd_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
mnuFileAdd.FontBold = True
mnuFileEdit.FontBold = False
End Sub
'delete actual record
Private Sub mnuFileDelete_Click()
Dim response
If tabGeneral.Tab = 0 Then
response = MsgBox("Are you sure about deleting this Player?", vbYesNo, "delete?")
If response = vbYes Then
DatParticipant.Recordset.Delete
Else
Exit Sub
End If
Else
response = MsgBox("Are you sure about deleting this stand?", vbYesNo, "delete?")
If response = vbYes Then
DatStands.Recordset.Delete
Else
Exit Sub
End If
End If
End Sub
Private Sub mnuFileDelete_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
mnuFileEdit.FontBold = False
mnuFileDelete.FontBold = True
mnuFileExit.FontBold = False
End Sub
Private Sub mnuFileEdit_Click()
anmSearch.Open "search.avi"
anmSearch.Play
DatStands.Recordset.Edit
DatParticipant.Recordset.Edit
cmdSave.Visible = True
cmdCancel.Visible = True
If tabGeneral.Tab = 0 Then
FraParticipant.Enabled = True
Else
fraStands.Enabled = True
End If
End Sub
Private Sub mnuFileEdit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
mnuFileAdd.FontBold = False
mnuFileEdit.FontBold = True
mnuFileDelete.FontBold = False
End Sub
'button exit
Private Sub mnuFileExit_Click()
Unload Me
'Mainform.Show
End Sub
Function menu_change()
If tabGeneral.Tab = 1 Then
mnuFileEdit.Caption = "&Edit stands"
mnuFileDelete.Caption = "&Delete stands"
mnuFileAdd.Caption = "&Add stands"
Else
mnuFileEdit.Caption = "&Edit player"
mnuFileDelete.Caption = "&Delete player"
mnuFileAdd.Caption = "&Add player"
End If
End Function
Private Sub mnuFileExit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
mnuFileDelete.FontBold = False
mnuFileExit.FontBold = True
End Sub
Private Sub tabGeneral_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
cmdSave.FontBold = False
cmdCancel.FontBold = False
mnuFileAdd.FontBold = False
mnuFileEdit.FontBold = False
mnuFileDelete.FontBold = False
mnuFileExit.FontBold = False
Label8.FontBold = False
Label9.FontBold = False
Call menu_change
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
EditMain.DatParticipant.Refresh
EditMain.DatStands.Refresh
End Sub
Private Sub Toolbar1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
mnuFileAdd.FontBold = False
mnuFileEdit.FontBold = False
mnuFileDelete.FontBold = False
mnuFileExit.FontBold = False
Timer1.Enabled = False
End Sub
Function Modife_player()
DatParticipant.Recordset.Edit
If TxtSexe = "Homme" Then
sexVar = 1
Else
sexVar = 2
End If
DatParticipant.Recordset.Update
End Function
Function setIDS()
Dim VarPays
Dim temp, temp2
temp = TxtPays
On Error Resume Next
DatPays.Recordset.MoveFirst
DatPays.Recordset.MoveFirst
For i = 1 To 100
With DatPays.Recordset
.MoveNext
VarPays = !Pays
If temp = VarPays Then
temp2 = !ID
Exit Function
End If
End With
Next
End Function
Function setIDP()
Dim VarSponsor
Dim temp3, temp4
temp3 = TxtSponsor
On Error Resume Next
DatParticipant.Recordset.MoveFirst
DatParticipant.Recordset.MoveFirst
For i = 1 To 100
With DatSponsor.Recordset
.MoveNext
VarSponsor = !sponsor
If temp3 = VarSponsor Then
temp4 = !ID
Exit Function
End If
End With
Next
End Function
'Private Sub TxtPays_Change()
'Data1.Recordset.Edit
' Call setIDS
'Data1.Recordset.Update
'End Sub
'Private Sub TxtSponsor_Change()
'datParticipant.Recordset.Edit
' Call setIDP
'datParticipant.Recordset.Update
'End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -