📄 frmhuiyuan.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmHuiYuan
BorderStyle = 3 'Fixed Dialog
Caption = "图书销售 选择会员"
ClientHeight = 4605
ClientLeft = 45
ClientTop = 330
ClientWidth = 9015
Icon = "FrmHuiYuan.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4605
ScaleWidth = 9015
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox TxtDengJi
Height = 390
Left = 1560
Locked = -1 'True
TabIndex = 19
ToolTipText = "会员等级 不可编辑"
Top = 600
Width = 2655
End
Begin VB.CommandButton CmdClose
Cancel = -1 'True
Caption = "取消(&C)"
Height = 375
Left = 7320
TabIndex = 2
Top = 840
Width = 1575
End
Begin VB.TextBox TxtUName
Height = 390
Left = 1560
TabIndex = 10
Top = 1080
Width = 2655
End
Begin VB.OptionButton OptionMan
Caption = "男"
Height = 255
Left = 1560
TabIndex = 9
Top = 1680
Value = -1 'True
Width = 495
End
Begin VB.OptionButton OptionFemail
Caption = "女"
Height = 255
Left = 2280
TabIndex = 8
Top = 1680
Width = 495
End
Begin VB.TextBox TxtUDanWei
Height = 390
Left = 1560
TabIndex = 7
Top = 2040
Width = 2655
End
Begin VB.TextBox TxtUDiZhi
Height = 390
Left = 1560
TabIndex = 6
Top = 2520
Width = 2655
End
Begin VB.TextBox TxtUMail
Height = 390
Left = 1560
TabIndex = 5
Top = 3000
Width = 2655
End
Begin VB.TextBox TxtUDianHua
Height = 390
Left = 1560
TabIndex = 4
Top = 3480
Width = 2655
End
Begin VB.TextBox TxtUMemo
Height = 3735
Left = 4440
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Top = 135
Width = 2655
End
Begin VB.CommandButton CmdRegMe
Caption = "选中该会员(&D)"
Height = 375
Left = 7320
TabIndex = 1
Top = 240
Width = 1575
End
Begin VB.TextBox TxtCard
BeginProperty DataFormat
Type = 0
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
Height = 390
Left = 1560
TabIndex = 0
ToolTipText = "非会员请留空"
Top = 120
Width = 2655
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 6000
Top = 4080
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "说明:如果顾客不是会员,请直接点击“选中该会员”。"
Height = 180
Left = 840
TabIndex = 22
Top = 4200
Width = 4500
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "人生格言:"
Height = 180
Left = 3315
TabIndex = 21
Top = 1680
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "等级:"
Height = 180
Left = 840
TabIndex = 20
Top = 720
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "姓名:"
Height = 180
Left = 840
TabIndex = 18
Top = 1170
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "性别:"
Height = 180
Left = 840
TabIndex = 17
Top = 1635
Width = 540
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "单位:"
Height = 180
Left = 840
TabIndex = 16
Top = 2130
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "地址:"
Height = 180
Left = 840
TabIndex = 15
Top = 2610
Width = 540
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "E-mail:"
Height = 180
Left = 660
TabIndex = 14
Top = 3090
Width = 720
End
Begin VB.Label Label29
AutoSize = -1 'True
Caption = "电话:"
Height = 180
Left = 840
TabIndex = 13
Top = 3570
Width = 540
End
Begin VB.Label Label30
AutoSize = -1 'True
Caption = "人生格言:"
Height = 180
Left = 3360
TabIndex = 12
Top = 1200
Width = 900
End
Begin VB.Label Label31
AutoSize = -1 'True
Caption = "会员帐(卡)号:"
Height = 180
Left = 120
TabIndex = 11
Top = 210
Width = 1260
End
End
Attribute VB_Name = "FrmHuiYuan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdClose_Click()
Unload Me
End Sub
Private Sub CmdRegMe_Click()
On Error GoTo errEnd
If TxtCard.Text = "" Then
HuiYuanKaHao = "Guest"
HYXingMing = "Guest"
HYDengJi = "☆☆☆☆☆"
Else
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from [会员表] where [会员卡号]=""" & TxtCard.Text & """"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "该会员帐号不存在!", vbOKOnly + vbExclamation, "选择会员"
TxtCard.SetFocus
TxtCard.SelStart = 0
TxtCard.SelLength = Len(TxtCard.Text)
Exit Sub
End If
End If
'进入售书
Unload Me
Load FrmSell
FrmSell.Show vbModal
Exit Sub
errEnd:
MsgBox "操作失败,操作数据库发生错误!", vbOKOnly + vbExclamation, "操作失败"
End Sub
Private Sub Form_Load()
Dim dbName As String
Dim connSTR As String
On Error GoTo errEnd
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"
connSTR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbName & ";Persist Security Info=False"
Adodc1.ConnectionString = connSTR
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "打开数据库出错"
End Sub
Private Sub TxtCard_LostFocus()
On Error GoTo errEnd
If TxtCard.Text <> "" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from [会员表] where [会员卡号]=""" & TxtCard.Text & """"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
'卡号
HuiYuanKaHao = Adodc1.Recordset!会员卡号 & ""
TxtUName.Text = Adodc1.Recordset!姓名 & ""
'姓名
HYXingMing = Adodc1.Recordset!姓名 & ""
If Adodc1.Recordset!性别 = "男" Then
OptionMan.Value = True
Else
OptionFemail.Value = True
End If
TxtUDiZhi.Text = Adodc1.Recordset!地址 & ""
TxtDengJi.Text = Adodc1.Recordset!会员等级 & ""
'等级
HYDengJi = Adodc1.Recordset!会员等级 & ""
TxtUDanWei.Text = Adodc1.Recordset!单位 & ""
TxtUMail.Text = Adodc1.Recordset!电子邮件 & ""
TxtUDianHua.Text = Adodc1.Recordset!电话 & ""
TxtUMemo.Text = Adodc1.Recordset!人生格言 & ""
Else
MsgBox "该会员帐号不存在!", vbOKOnly + vbExclamation, "选择会员"
TxtCard.SetFocus
TxtCard.SelStart = 0
TxtCard.SelLength = Len(TxtCard.Text)
Exit Sub
End If
End If
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "检索会员信息出错"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -