📄 frm_hyfind.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frm_hyfind
BorderStyle = 3 'Fixed Dialog
Caption = "查询条件"
ClientHeight = 4020
ClientLeft = 30
ClientTop = 420
ClientWidth = 7500
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4020
ScaleWidth = 7500
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.CheckBox Check2
Height = 372
Left = 3600
TabIndex = 20
Top = 2160
Width = 1092
End
Begin VB.CheckBox Check1
Height = 372
Left = 3600
TabIndex = 19
Top = 1680
Width = 732
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 336
Left = 1440
TabIndex = 18
Top = 720
Width = 5772
End
Begin VB.TextBox txtIdCard
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1440
TabIndex = 7
Top = 1140
Width = 2052
End
Begin VB.TextBox txtAddress
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1440
TabIndex = 6
Top = 2640
Width = 5772
End
Begin VB.TextBox txtPhone
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 5160
TabIndex = 5
Top = 1140
Width = 2052
End
Begin VB.ComboBox ComboDuty
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 336
Left = 5160
TabIndex = 4
Top = 240
Width = 2052
End
Begin VB.TextBox txtEmpID
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1440
MaxLength = 8
TabIndex = 3
Top = 240
Width = 2052
End
Begin VB.CommandButton cmdClose
Caption = "关闭(&Q)"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 4560
TabIndex = 2
Top = 3360
Width = 1332
End
Begin VB.CommandButton cmdFind
Caption = "确定(&O)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 1680
TabIndex = 1
Top = 3360
Width = 1332
End
Begin VB.CommandButton cmdCencal
Caption = "取消(&C)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 3120
TabIndex = 0
Top = 3360
Width = 1332
End
Begin MSComCtl2.DTPicker DTP_Birth
Height = 372
Left = 1440
TabIndex = 8
Top = 1656
Width = 2052
_ExtentX = 3625
_ExtentY = 661
_Version = 393216
Format = 6750209
CurrentDate = 37501
End
Begin MSComCtl2.DTPicker DTP_Date
Height = 372
Left = 1440
TabIndex = 9
Top = 2124
Width = 2052
_ExtentX = 3625
_ExtentY = 661
_Version = 393216
Format = 6750209
CurrentDate = 37501
End
Begin VB.Label Label14
Caption = "联系人:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 240
TabIndex = 17
Top = 1200
Width = 1572
End
Begin VB.Label Label10
Caption = "联系地址:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 240
TabIndex = 16
Top = 2640
Width = 1212
End
Begin VB.Label Label8
Caption = "联系电话:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 3960
TabIndex = 15
Top = 1200
Width = 1212
End
Begin VB.Label Label6
Caption = "会员类型:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 3960
TabIndex = 14
Top = 240
Width = 1332
End
Begin VB.Label Label5
Caption = "有效期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 240
TabIndex = 13
Top = 2124
Width = 1212
End
Begin VB.Label Label4
Caption = "入会时间:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 240
TabIndex = 12
Top = 1680
Width = 1212
End
Begin VB.Label Label2
Caption = "会员名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 240
TabIndex = 11
Top = 720
Width = 1212
End
Begin VB.Label Label1
Caption = "会员编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 240
TabIndex = 10
Top = 240
Width = 1212
End
End
Attribute VB_Name = "frm_hyfind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Private Sub cmdCencal_Click()
cmdFind.Enabled = False
cmdClose.Enabled = True
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdFind_Click()
sWhere = ""
sWhere = sWhere & IIf(Len(Trim(txtEmpID.Text)) = 0, "", " 会员编号= '" & Trim(txtEmpID.Text) & "' and ")
sWhere = sWhere & IIf(Len(Trim(Combo1.Text)) = 0, "", " 会员名称= '" & Trim(Combo1.Text) & "' and ")
sWhere = sWhere & IIf(Len(Trim(txtIdCard.Text)) = 0, "", " 联系人= '" & txtIdCard.Text & "' and ")
sWhere = sWhere & IIf(Len(Trim(txtPhone.Text)) = 0, "", " 联系电话= '" & txtPhone.Text & "' and ")
sWhere = sWhere & IIf(Len(Trim(ComboDuty.Text)) = 0, "", " 会员类型= '" & ComboDuty.Text & "' and ")
If Check1.Value = 1 Then
sWhere = sWhere & IIf(Len(Trim(DTP_Birth.Value)) = 0, "", " 入会时间= '" & Format(DTP_Birth.Value, "yyyy-mm-dd") & "' and ")
End If
If Check2.Value = 1 Then
sWhere = sWhere & IIf(Len(Trim(DTP_Date.Value)) = 0, "", " 会员有效期= '" & Format(DTP_Date.Value, "yyyy-mm-dd") & "' and ")
End If
sWhere = sWhere & IIf(Len(Trim(txtAddress.Text)) = 0, "", " 联系地址= '" & txtAddress.Text & "' and ")
If Len(Trim(sWhere)) > 0 Then
sWhere = Left(sWhere, Len(sWhere) - 4)
sWhere = " where " & sWhere
End If
sWhere1 = sWhere
sWhere = " select * from 会员信息表" & sWhere
maSys_db.Execute "delete from 会员信息临时表"
pssql = "insert into 会员信息临时表 select 会员编号,会员名称,会员类型,联系人,联系电话,联系地址,IC卡号,卡上余额,卡上积分,入会时间,会员有效期,备注 from 会员信息表 " & sWhere1
maSys_db.Execute pssql
cmdFind.Enabled = False
cmdClose.Enabled = True
Unload Me
End Sub
Private Sub ComboDuty_Get()
Set rs = GetRecordset(maSys_db, "select * from 会员类型设置表 ")
If Not rs.EOF Then
ComboDuty.Clear
Do While Not rs.EOF
ComboDuty.AddItem Trim(rs!类型名称)
rs.MoveNext
Loop
Else
ComboDuty.Clear
str_Msg = MsgBox("请先设置会员类型信息!", vbInformation + vbOKOnly, "中芯德立提示信息")
End If
End Sub
Private Sub sHymc()
Set rs = GetRecordset(maSys_db, "select * from 会员信息表")
If Not rs.EOF Then
Combo1.Clear
sListNo = 0
Do While Not rs.EOF
Combo1.AddItem Trim(rs!会员名称)
' sHybh(sListNo) = rs!会员编号
sListNo = sListNo + 1
rs.MoveNext
Loop
Else
Combo1.Clear
MsgBox "请先注册会员信息!", vbInformation + vbOKOnly, "中芯德立提示信息"
End If
End Sub
Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
DTP_Birth.Value = Format(Now, "yyyy-mm-dd")
DTP_Date.Value = Format(Now, "yyyy-mm-dd")
Call ComboDuty_Get
Call sHymc
End Sub
Private Sub txtEmpID_KeyPress(KeyAscii As Integer)
If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub txtEmpID_LostFocus()
txtEmpID = Format(txtEmpID, "00000000")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -