📄 frm_zdxz.frm
字号:
VERSION 5.00
Begin VB.Form frm_zdxz
BackColor = &H0080C0FF&
BorderStyle = 3 'Fixed Dialog
Caption = "项目选择"
ClientHeight = 3840
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 6720
Icon = "frm_zdxz.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3840
ScaleWidth = 6720
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
BackColor = &H00C0E0FF&
Cancel = -1 'True
Height = 390
Index = 1
Left = 5415
MaskColor = &H00FFFFFF&
Picture = "frm_zdxz.frx":000C
Style = 1 'Graphical
TabIndex = 7
Top = 3330
UseMaskColor = -1 'True
Width = 1170
End
Begin VB.ComboBox Combo1
BackColor = &H00C0E0FF&
Height = 300
Left = 120
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 0
Top = 3405
Width = 1830
End
Begin VB.CommandButton Command2
BackColor = &H00C0E0FF&
Default = -1 'True
Enabled = 0 'False
Height = 390
Index = 0
Left = 4125
MaskColor = &H00FFFFFF&
Picture = "frm_zdxz.frx":0FC6
Style = 1 'Graphical
TabIndex = 6
Top = 3330
UseMaskColor = -1 'True
Width = 1170
End
Begin VB.ListBox List3
BackColor = &H00C0E0FF&
Height = 2580
Left = 4755
TabIndex = 4
Top = 405
Width = 1830
End
Begin VB.CommandButton Command1
BackColor = &H00C0E0FF&
Caption = "<<"
Enabled = 0 'False
Height = 300
Index = 1
Left = 4050
Style = 1 'Graphical
TabIndex = 5
ToolTipText = "删除已选项目"
Top = 1800
Width = 570
End
Begin VB.CommandButton Command1
BackColor = &H00C0E0FF&
Caption = ">>"
Enabled = 0 'False
Height = 300
Index = 0
Left = 4050
Style = 1 'Graphical
TabIndex = 3
ToolTipText = "选择项目"
Top = 1275
Width = 570
End
Begin VB.ListBox List2
BackColor = &H00C0E0FF&
Height = 2580
Left = 2085
Sorted = -1 'True
TabIndex = 2
Top = 405
Width = 1830
End
Begin VB.ListBox List1
BackColor = &H00C0E0FF&
Height = 2580
Left = 120
Sorted = -1 'True
TabIndex = 1
Top = 420
Width = 1830
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "美容类别:"
Height = 180
Index = 0
Left = 135
TabIndex = 17
Top = 3165
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "已选项目:"
Height = 180
Index = 6
Left = 4740
TabIndex = 16
Top = 180
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Label2"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 225
Index = 2
Left = 3210
TabIndex = 15
Top = 3525
Width = 570
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "包月收费:"
Height = 180
Index = 5
Left = 2130
TabIndex = 14
Top = 3525
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Label2"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 225
Index = 1
Left = 3210
TabIndex = 13
Top = 3285
Width = 570
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单次收费:"
Height = 180
Index = 4
Left = 2130
TabIndex = 12
Top = 3285
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Label2"
ForeColor = &H000000FF&
Height = 180
Index = 0
Left = 3210
TabIndex = 11
Top = 3045
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "功能或名称:"
Height = 180
Index = 3
Left = 2130
TabIndex = 10
Top = 3045
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "项目:"
Height = 180
Index = 2
Left = 2070
TabIndex = 9
Top = 180
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "细分类别:"
Height = 180
Index = 1
Left = 135
TabIndex = 8
Top = 195
Width = 900
End
End
Attribute VB_Name = "frm_zdxz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Dim db As Database
Dim rec As Recordset
Dim fy As Single
Private Sub OKButton_Click()
End Sub
Private Sub Combo1_Click()
For i = 0 To 2
Label2(i) = ""
Next i
sqlstr = "select distinct 细分类别 from 项目收费表 where 美容类别='" + Combo1.Text + "'"
Set rec = db.OpenRecordset(sqlstr)
List1.Clear
Do While Not rec.EOF
If IsNull(rec.Fields("细分类别")) Or rec.Fields("细分类别") = "" Then
Else
List1.AddItem rec.Fields("细分类别")
End If
rec.MoveNext
Loop
If List1.ListCount = 0 Then
sqlstr = "select distinct 项目 from 项目收费表 where 美容类别='" + Combo1.Text + "'"
Set rec = db.OpenRecordset(sqlstr)
List2.Clear
Do While Not rec.EOF
List2.AddItem rec.Fields("项目")
rec.MoveNext
Loop
If List2.ListCount = 0 Then
Else
List2.ListIndex = 0
List2_Click
End If
Else
List1.ListIndex = 0
End If
End Sub
Private Sub Command1_Click(Index As Integer)
If Index = 0 Then
If Me.Caption = "项目选择(开卡)" Then
If Label2(2) = "" Then
MsgBox "该项目没有登记包月费用,不能选择", vbOKOnly + vbCritical, "错误"
Exit Sub
End If
Else
If Label2(1) = "" Then
MsgBox "该项目没有登记单次费用,不能选择", vbOKOnly + vbCritical, "错误"
Exit Sub
End If
End If
For i = 0 To List3.ListCount - 1
wz = InStr(1, List3.List(i), "-")
zfc = Left(List3.List(i), wz - 1)
If List2.Text = zfc Then
MsgBox "您选择的项目已经被选入", vbOKOnly + vbCritical, "错误"
Exit Sub
End If
Next i
If Me.Caption = "项目选择(开卡)" Then
List3.AddItem List2.Text + "-" + Label2(2)
fy = fy + Val(Label2(2))
Else
List3.AddItem List2.Text + "-" + Label2(1)
fy = fy + Val(Label2(1))
End If
Command2(0).Enabled = True
Else
wz = InStr(1, List3.List(i), "-")
zfc = Right(List3.List(i), wz + 1)
fy = fy - Val(zfc)
List3.RemoveItem List3.ListIndex
If List3.ListCount = 0 Then
Command1(1).Enabled = False
Command2(0).Enabled = False
Else
List3.ListIndex = 0
End If
End If
End Sub
Private Sub Command2_Click(Index As Integer)
If Index = 0 Then
For i = 0 To List3.ListCount - 2
wz = InStr(1, List3.List(i), "-")
zfc = Left(List3.List(i), wz - 1)
zd = zd + zfc + ","
Next i
wz = InStr(1, List3.List(List3.ListCount - 1), "-")
zfc = Left(List3.List(List3.ListCount - 1), wz - 1)
zd = zd + zfc
If Me.Caption = "项目选择(开卡)" Then
frm_kxk.Text1(3) = zd
frm_kxk.Text1(2) = Trim(Str(fy))
'frm_kxk.Text1(7) = frm_kxk.Text1(2)
Unload Me
'frm_kxk.Show 1
Else
frm_dcczdj.Text1(3) = zd
frm_dcczdj.Text1(2) = Trim(Str(fy))
frm_dcczdj.Text1(4) = frm_dcczdj.Text1(2)
Unload Me
'frm_dcczdj.Show 1
End If
Else
If Me.Caption = "项目选择(开卡)" Then
Unload Me
' frm_kxk.Show 1
Else
Unload Me
' frm_dcczdj.Show 1
End If
End If
End Sub
Private Sub Form_Load()
For i = 0 To 2
Label2(i) = ""
Next i
fy = 0
'Set db = OpenDatabase(AppPath + "datas\mry.mdb")
If jjj = 2 Then
sqlstr = "select distinct 美容类别 from 项目收费表 where 美容类别 like '*美发*'"
Else
sqlstr = "select distinct 美容类别 from 项目收费表"
End If
Set rec = db.OpenRecordset(sqlstr)
Do While Not rec.EOF
Combo1.AddItem rec.Fields("美容类别")
rec.MoveNext
Loop
If Combo1.ListCount = 0 Then
Else
Combo1.ListIndex = 0
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
'db.Close
'Set db = Nothing
End Sub
Private Sub List1_Click()
sqlstr = "select distinct 项目 from 项目收费表 where 美容类别='" + Combo1.Text + "' and 细分类别='" + List1.Text + "'"
Set rec = db.OpenRecordset(sqlstr)
List2.Clear
Do While Not rec.EOF
List2.AddItem rec.Fields("项目")
rec.MoveNext
Loop
For i = 0 To 2
Label2(i) = ""
Next i
If List2.ListCount = 0 Then
Else
List2.ListIndex = 0
List2_Click
End If
End Sub
Private Sub List2_Click()
If List2.SelCount = 0 Then
Command1(0).Enabled = False
Else
Command1(0).Enabled = True
End If
sqlstr = "select * from 项目收费表 where 美容类别='" + Combo1.Text + "' and 细分类别 like '" + List1.Text + "*' and 项目='" + List2.Text + "'"
Set rec = db.OpenRecordset(sqlstr)
If rec.EOF And rec.BOF Then
Else
Label2(0) = IIf(IsNull(rec.Fields("功能或名称")), "", rec.Fields("功能或名称"))
Label2(1) = IIf(IsNull(rec.Fields("单次收费")), "", rec.Fields("单次收费"))
Label2(2) = IIf(IsNull(rec.Fields("包月收费")), "", rec.Fields("包月收费"))
End If
End Sub
Private Sub List3_Click()
If List3.SelCount = 0 Then
Command1(1).Enabled = False
Else
Command1(1).Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -