📄 memberlistfr.frm
字号:
VERSION 5.00
Begin VB.Form AddMemberFr
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 3675
ClientLeft = 45
ClientTop = 330
ClientWidth = 5490
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3675
ScaleWidth = 5490
Begin VB.TextBox Text6
BeginProperty DataFormat
Type = 1
Format = """¥""#,##0.00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 2
EndProperty
Height = 375
Left = 1200
TabIndex = 11
Text = "0"
Top = 2160
Width = 1455
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "MemberListFr.frx":0000
Left = 4080
List = "MemberListFr.frx":000A
TabIndex = 10
Text = "男"
Top = 120
Width = 975
End
Begin VB.TextBox Text4
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 375
Left = 1200
MaxLength = 18
TabIndex = 9
Text = "0"
Top = 1680
Width = 4095
End
Begin VB.TextBox Text3
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 375
Left = 1200
TabIndex = 8
Text = "0"
Top = 1080
Width = 4095
End
Begin VB.TextBox Text2
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 375
Left = 1200
TabIndex = 7
Text = "0"
Top = 600
Width = 2175
End
Begin VB.TextBox Text1
Height = 375
Left = 1200
TabIndex = 1
Text = "Text1"
Top = 120
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 495
Left = 2040
TabIndex = 0
Top = 2880
Width = 1215
End
Begin VB.Label Label6
Caption = "第一次消费:"
Height = 375
Left = 120
TabIndex = 12
Top = 2280
Width = 1215
End
Begin VB.Label Label5
Caption = "身份证:"
Height = 375
Left = 120
TabIndex = 6
Top = 1800
Width = 735
End
Begin VB.Label Label4
Caption = "卡号:"
Height = 255
Left = 120
TabIndex = 5
Top = 1200
Width = 615
End
Begin VB.Label Label3
Caption = "电话:"
Height = 255
Left = 120
TabIndex = 4
Top = 720
Width = 855
End
Begin VB.Label Label2
Caption = "姓别:"
Height = 375
Left = 3480
TabIndex = 3
Top = 120
Width = 735
End
Begin VB.Label Label1
Caption = "会员名:"
Height = 375
Left = 120
TabIndex = 2
Top = 240
Width = 1095
End
End
Attribute VB_Name = "AddMemberFr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim addcon As New Class1
Dim addrs As New Class1
Dim CardType As String
Private Sub Command1_Click()
Dim xfno, str As String, username1 As String, sex1 As String, tel1 As String, cardno1 As Double, usercode1 As Double
Dim sql1 As String
username1 = Text1.Text
sex1 = Combo1.Text
tel1 = Text2.Text
cardno1 = Text3.Text
usercode1 = Text4.Text
xfno = Text6.Text
Select Case xfno
Case Is <= 6000
CardType = "普通会员"
Case 6000 To 7999
CardType = "普通卡"
Case 8000 To 9999
CardType = "银卡"
Case Is >= 10000
CardType = "金卡"
End Select
If addcon.ocn.State = False Then
addcon.ocn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=DATA.mdb;Persist security info=false"
addcon.ocn.Open
End If
str1 = "select*from userlist where cardno=" & cardno1
addrs.rs.Open str1, addcon.ocn, 1, 1
If Not addrs.rs.EOF Then
MsgBox "此卡号已经存在,请另外选择一个卡号"
addrs.rs.Close
Set addrs.rs = Nothing
addcon.ocn.Close
Set addcon.ocn = Nothing
Exit Sub
End If
'str = "insert into userlist (username,sex,usercode,tel,cardno)values(username,sex,usercode,tel,cardno) "
addcon.ocn.Execute "insert into userlist (username,sex,usercode,tel,cardno,allxf)" & _
"values('" & username1 & "','" & sex1 & "','" & usercode1 & "','" & tel1 & "','" & cardno1 & "','" & xfno & "')"
'addcon.ocn.Execute "INSERT INTO userlist(adddate, allxf, cardno, cardtype, lastxf, sex, tel, usercode" & _
' ", username) VALUES (now(), 111, 11111, 4440, 11111, 041, 111, 111, 01)"
'If addrs.rs.State = True Then
'addrs.rs.Close
'Set addrs.rs = Nothing
'End If
'If addrs.rs.State = True Then
addrs.rs.Close
Set addrs.rs = Nothing
'End If
sql1 = "select id from userlist where username='" & username1 & "'"
addrs.rs.Open sql1, addcon.ocn, 1, 1
id = CInt(addrs.rs.Fields.Item(0))
addcon.ocn.Execute "insert into xflist(id,username,cardno,xf,xftime)values('" & id & "','" & username1 & "','" & cardno1 & "','" & xfno & "',now())"
Unload AddMemberFr
MainForm.Show
End Sub
Private Sub Form_Unload(Cancel As Integer)
MainForm.Show
End Sub
Private Sub Text3_Change()
If IsNumeric(Text3.Text) = False Then
MsgBox "data is not allowed"
Text3.SetFocus
End If
End Sub
Private Sub Text4_Change()
If IsNumeric(Text4.Text) = False Then
MsgBox "data is not allowed"
Text4.SetFocus
End If
End Sub
Private Sub Text6_Change()
If IsNumeric(Text6.Text) = False Then
MsgBox "data is not allowed"
Text6.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -