?? frmverify.frm
字號:
VERSION 5.00
Begin VB.Form frmVerify
BackColor = &H00FF0000&
Caption = "Verify"
ClientHeight = 6915
ClientLeft = 2100
ClientTop = 1320
ClientWidth = 6825
ForeColor = &H00FF0000&
LinkTopic = "Form1"
ScaleHeight = 6915
ScaleWidth = 6825
Begin VB.CommandButton cmdUpdate
Caption = "Update"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 7
ToolTipText = "Update Member Particulars?"
Top = 6240
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton cmdBack
Caption = "Back"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 8
ToolTipText = "Back to previous form"
Top = 6240
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton cmdEdit
Caption = "Edit"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 9
ToolTipText = "Edit Member Particulars?"
Top = 6240
Width = 1215
End
Begin VB.CommandButton cmdChoice
Caption = "Ok"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 10
ToolTipText = "Go to next form?"
Top = 6240
Width = 1215
End
Begin VB.Frame Frame1
BackColor = &H00FF0000&
Caption = "Customer Particulars"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 4935
Left = 240
TabIndex = 12
Top = 960
Width = 6375
Begin VB.TextBox txtverifyField
Enabled = 0 'False
Height = 375
Index = 0
Left = 2640
TabIndex = 0
ToolTipText = "Member ID"
Top = 480
Width = 2775
End
Begin VB.TextBox txtverifyField
Enabled = 0 'False
Height = 615
Index = 2
Left = 2640
MultiLine = -1 'True
TabIndex = 2
ToolTipText = "Member Address"
Top = 1680
Width = 2775
End
Begin VB.TextBox txtverifyField
Enabled = 0 'False
Height = 375
Index = 4
Left = 2640
MaxLength = 8
TabIndex = 4
ToolTipText = "Member Phone Number"
Top = 3120
Width = 2775
End
Begin VB.TextBox txtverifyField
Enabled = 0 'False
Height = 375
Index = 3
Left = 2640
MaxLength = 6
TabIndex = 3
ToolTipText = "Member Postal Code"
Top = 2520
Width = 2775
End
Begin VB.TextBox txtverifyField
Enabled = 0 'False
Height = 375
Index = 1
Left = 2640
TabIndex = 1
ToolTipText = "Member Name"
Top = 1080
Width = 2775
End
Begin VB.TextBox txtverifyField
Enabled = 0 'False
Height = 375
Index = 5
Left = 2640
MaxLength = 8
TabIndex = 5
ToolTipText = "Tapes Rented"
Top = 3720
Width = 2775
End
Begin VB.TextBox txtverifyField
Enabled = 0 'False
Height = 375
Index = 6
Left = 2640
MaxLength = 8
TabIndex = 6
ToolTipText = "Tapes Reserved"
Top = 4320
Width = 2775
End
Begin VB.Label Label9
BackColor = &H00FF0000&
Caption = "ID:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 480
TabIndex = 20
Top = 480
Width = 735
End
Begin VB.Label Label4
BackColor = &H00FF0000&
Caption = "Phone Number:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 480
TabIndex = 18
Top = 3120
Width = 2055
End
Begin VB.Label Label3
BackColor = &H00FF0000&
Caption = "Postal Code:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 495
Left = 480
TabIndex = 17
Top = 2520
Width = 1695
End
Begin VB.Label Label2
BackColor = &H00FF0000&
Caption = "Address:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 480
TabIndex = 16
Top = 1680
Width = 1215
End
Begin VB.Label label1
BackColor = &H00FF0000&
Caption = "Name: "
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 480
TabIndex = 15
Top = 1080
Width = 735
End
Begin VB.Label Label5
BackColor = &H00FF0000&
Caption = "Tapes Rented:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 480
TabIndex = 14
Top = 3720
Width = 2055
End
Begin VB.Label Label6
BackColor = &H00FF0000&
Caption = "Tapes Reserved:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 480
TabIndex = 13
Top = 4320
Width = 2055
End
End
Begin VB.Label Label8
BackColor = &H00FF0000&
Caption = "ID:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 720
TabIndex = 19
Top = 1440
Width = 735
End
Begin VB.Label Label7
Alignment = 2 'Center
BackColor = &H00FF0000&
Caption = "Verification of Particulars"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 615
Left = 1200
TabIndex = 11
Top = 240
Width = 4575
End
End
Attribute VB_Name = "frmVerify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdBack_Click()
Dim i As Integer
frmVerify.Show
cmdUpdate.Visible = False
cmdback.Visible = False
cmdEdit.Visible = True
cmdChoice.Visible = True
For i = 0 To 6
txtverifyField(i).Enabled = False
Next i
End Sub
Private Sub cmdChoice_Click()
frmVerify.Hide
frmChoices.Show
End Sub
Private Sub cmdEdit_Click()
Dim i As Integer
cmdUpdate.Visible = True
cmdback.Visible = True
cmdEdit.Visible = False
cmdChoice.Visible = False
For i = 1 To 4
txtverifyField(i).Enabled = True
Next i
End Sub
Private Sub cmdUpdate_Click()
If Len(Trim$(txtverifyField(1).Text)) = 0 Or Len(Trim$(txtverifyField(2).Text)) = 0 Or Len(Trim$(txtverifyField(3).Text)) = 0 Or Len(Trim$(txtverifyField(4).Text)) = 0 _
Or Len(Trim$(txtverifyField(5).Text)) = 0 Or Len(Trim$(txtverifyField(6).Text)) = 0 Then
MsgBox "Please finish entering all customer particulars"
Else
UpdateParticulars
End If
End Sub
Private Sub UpdateParticulars()
Dim strFields(0 To 6) As String, strSQL As String
Dim varData() As Variant
Dim i As Integer
strFields(0) = txtverifyField(0)
For i = 1 To 6
strFields(i) = ConvertToField(txtverifyField(i).Text, False)
Next i
'For i = 5 To 6
'strFields(i) = ConvertToField(txtverifyField(i).Text, True)
'Next i
strSQL = "UPDATE Members SET " _
& "Name = '" & strFields(1) & "'," _
& "Address = '" & strFields(2) & "'," _
& "PostalCode = " & strFields(3) & "," _
& "Phone = " & strFields(4) & "," _
& "TapesRented = " & strFields(5) & "," _
& "TapesReserved = " & strFields(6) _
& " where ID = " & strFields(0)
MsgBox strSQL
If RunActionQuery(strSQL) = 0 Then
MsgBox "Edit Unsuccessful.Try again"
Else
MsgBox "Edit Successful"
cmdUpdate.Visible = False
cmdback.Visible = False
cmdEdit.Visible = True
cmdChoice.Visible = True
For i = 0 To 6
txtverifyField(i).Enabled = False
Next i
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -