📄 frmcustomers.frm
字号:
VERSION 5.00
Begin VB.Form frmcustomers
BackColor = &H00FFFFFF&
Caption = "鲜花订购系统(客户管理)"
ClientHeight = 6615
ClientLeft = 60
ClientTop = 630
ClientWidth = 7170
Icon = "frmcustomers.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "frmcustomers.frx":0E42
ScaleHeight = 6615
ScaleWidth = 7170
WindowState = 2 'Maximized
Begin VB.CommandButton Command1
BackColor = &H00FFFFFF&
Caption = "最前"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 14
Top = 5520
Width = 855
End
Begin VB.CommandButton Command2
BackColor = &H00FFFFFF&
Caption = "上"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3360
TabIndex = 13
Top = 5520
Width = 735
End
Begin VB.CommandButton Command3
BackColor = &H00FFFFFF&
Caption = "下"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4080
TabIndex = 12
Top = 5520
Width = 735
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
Caption = "最后"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4800
TabIndex = 11
Top = 5520
Width = 735
End
Begin VB.CommandButton Command5
BackColor = &H00FFFFFF&
Caption = "添加"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 10
Top = 5880
Width = 855
End
Begin VB.CommandButton Command6
BackColor = &H00FFFFFF&
Caption = "保存"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3360
TabIndex = 9
Top = 5880
Width = 735
End
Begin VB.CommandButton Command7
BackColor = &H00FFFFFF&
Caption = "删除"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4080
TabIndex = 8
Top = 5880
Width = 735
End
Begin VB.CommandButton Command8
BackColor = &H00FFFFFF&
Caption = "退出"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4800
TabIndex = 7
Top = 5880
Width = 735
End
Begin VB.Frame Frame1
BackColor = &H00FFFFFF&
Caption = "信用卡类型"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 1680
TabIndex = 6
Top = 3240
Width = 3735
Begin VB.OptionButton Option2
BackColor = &H00FFFFFF&
Caption = "visa"
BeginProperty Font
Name = "华文中宋"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2280
TabIndex = 16
Top = 360
Width = 1215
End
Begin VB.OptionButton Option1
BackColor = &H00FFFFFF&
Caption = "master"
BeginProperty Font
Name = "华文中宋"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 15
Top = 360
Width = 1575
End
End
Begin VB.TextBox Text3
Height = 375
Left = 2280
TabIndex = 5
Top = 2280
Width = 3375
End
Begin VB.TextBox Text2
Height = 375
Left = 2280
TabIndex = 3
Top = 1440
Width = 3375
End
Begin VB.TextBox Text1
Height = 375
Left = 2280
TabIndex = 1
Top = 600
Width = 1575
End
Begin VB.Image Image1
Height = 1800
Left = 8760
Picture = "frmcustomers.frx":13A82
Stretch = -1 'True
Top = 1800
Width = 1680
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
Caption = "信用卡号码"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 4
Top = 2280
Width = 1575
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
Caption = "电子邮件"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 2
Top = 1440
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "客户编号"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 0
Top = 600
Width = 1215
End
Begin VB.Menu file
Caption = "操作(&D)"
Begin VB.Menu add
Caption = "添加"
Shortcut = ^B
End
Begin VB.Menu gai
Caption = "更改"
Shortcut = ^F
End
Begin VB.Menu delete
Caption = "删除"
Shortcut = ^E
End
Begin VB.Menu priove
Caption = "上一个"
Shortcut = ^K
End
Begin VB.Menu next
Caption = "下一个"
Shortcut = ^C
End
Begin VB.Menu exit
Caption = "退出"
Shortcut = ^D
End
End
End
Attribute VB_Name = "frmcustomers"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''客户管理窗体中''''''''''''''''''''''''''''''''''
Private Sub add_Click()
Call Command5_Click
End Sub
'查看第一个数据,并显示
Private Sub Command1_Click()
rs1.MoveFirst
Call showcustomer
End Sub
'查看上一个数据,并显示
Private Sub Command2_Click()
rs1.MovePrevious
If rs1.BOF = True Then
rs1.MoveLast
End If
Call showcustomer
End Sub
'查看下一个数据,并显示
Private Sub Command3_Click()
rs1.MoveNext
If rs1.EOF = True Then
rs1.MoveFirst
End If
Call showcustomer
End Sub
'查看最后一个数据,并显示
Private Sub Command4_Click()
rs1.MoveLast
Call showcustomer
End Sub
'添加数据
Private Sub Command5_Click()
If Text1.Text <> Empty And Text2.Text <> Empty And Text3.Text <> Empty Then
rs1.AddNew
rs1.Fields("customercode").Value = Text1.Text
rs1.Fields("customeremail").Value = Text2.Text
rs1.Fields("cardnumber").Value = Text3.Text
If Option1.Value = True Then
rs1.Fields("card").Value = "master"
ElseIf Option2.Value = True Then
rs1.Fields("card").Value = "visa"
End If
rs1.Update
MsgBox "数据添加成功!", vbInformation + vbOKOnly, "成功"
End If
End Sub
'更改数据
Private Sub Command6_Click()
rs1.Fields("customercode").Value = Text1.Text
rs1.Fields("customeremail").Value = Text2.Text
rs1.Fields("cardnumber").Value = Text3.Text
If Option1.Value = True Then
rs1.Fields("card").Value = "master"
ElseIf Option2.Value = True Then
rs1.Fields("card").Value = "visa"
End If
rs1.Update
MsgBox "修改成功!", vbInformation + vbOKOnly, "修改成功"
End Sub
'删除数据
Private Sub Command7_Click()
If MsgBox("数据删除后将不能恢复,你确定要删除吗?", vbQuestion + vbYesNo, "提示信息") = vbYes Then
rs1.delete adAffectCurrent
rs1.UpdateBatch adAffectAllChapters
rs1.MoveFirst
Call showcustomer
MsgBox "数据删除成功"
End If
End Sub
'退出
Private Sub Command8_Click()
Unload Me
End Sub
Private Sub delete_Click()
Call Command7_Click
End Sub
Private Sub exit_Click()
Unload Me
End Sub
'查询客户表中的数据,并显示第一个
Private Sub Form_Load()
Dim strsql1 As String
strsql1 = "select * from customers"
Set rs1 = Nothing
Call rs1.Open(strsql1, g_dbcon, adOpenDynamic, adLockOptimistic, -1)
rs1.MoveFirst
Call showcustomer
End Sub
Private Sub gai_Click()
Call Command6_Click
End Sub
Private Sub next_Click()
Call Command3_Click
End Sub
Private Sub priove_Click()
Call Command2_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -