📄 frm_dcczdj.frm
字号:
Left = 3510
TabIndex = 29
Top = 2730
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单次处置记帐凭证"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 285
Index = 9
Left = 1665
TabIndex = 28
Top = 210
Width = 2415
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "2000-12-25"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 225
Index = 0
Left = 855
TabIndex = 27
Top = 825
Width = 960
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "003911"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 225
Index = 1
Left = 4335
TabIndex = 26
Top = 825
Width = 630
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "王 晶"
ForeColor = &H00C00000&
Height = 180
Index = 7
Left = 915
TabIndex = 25
Top = 2655
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "类别:"
Height = 180
Index = 10
Left = 180
TabIndex = 24
Top = 3120
Width = 540
End
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "经理密码:"
ForeColor = &H00000000&
Height = 180
Index = 15
Left = 6012
TabIndex = 38
Top = 1704
Width = 900
End
End
Attribute VB_Name = "frm_dcczdj"
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 sqlrec As Recordset
Private Sub OKButton_Click()
End Sub
Private Sub Check1_Click()
If Check1.Value Then
Text1(5) = 0
Text1(4) = 0
Text1(2).Enabled = False
Text1(4).Enabled = False
Text1(5).Enabled = False
Text1(6) = "经理同意"
Text4.Enabled = True
Else
Text1(4) = 10
Text1(5) = Text1(2)
Text1(2).Enabled = True
Text1(4).Enabled = True
Text1(5).Enabled = True
Text4.Enabled = False
Text1(6) = ""
End If
End Sub
Private Sub Combo1_Click(Index As Integer)
If Index = 0 Then
Text1(3).Text = ""
If Left(Combo1(0).Text, 2) = "单次" Or Left(Combo1(0).Text, 2) = "美发" Then
Combo1(1).Visible = True
Label1(8).Visible = True
Else
Combo1(1).Visible = False
Label1(8).Visible = False
End If
Select Case Combo1(0).Text
Case "单次收据"
If dcsj_maxno = "9999999" Then
MsgBox "编号已经饱和,请全部删除", vbOKOnly + vbCritical, "错误"
Combo1(0).RemoveItem Combo1(0).ListIndex
Exit Sub
End If
ss = Trim(Str(Val(dcsj_maxno) + 1))
Case "单次现金"
If dcxj_maxno = "9999999" Then
MsgBox "编号已经饱和,请全部删除", vbOKOnly + vbCritical, "错误"
Combo1(0).RemoveItem Combo1(0).ListIndex
Exit Sub
End If
ss = Trim(Str(Val(dcxj_maxno) + 1))
Case "化妆品收据"
If hzpsj_maxno = "9999999" Then
MsgBox "编号已经饱和,请全部删除", vbOKOnly + vbCritical, "错误"
Combo1(0).RemoveItem Combo1(0).ListIndex
Exit Sub
End If
ss = Trim(Str(Val(hzpsj_maxno) + 1))
Case "化妆品现金"
If hzpxj_maxno = "9999999" Then
MsgBox "编号已经饱和,请全部删除", vbOKOnly + vbCritical, "错误"
Combo1(0).RemoveItem Combo1(0).ListIndex
Exit Sub
End If
ss = Trim(Str(Val(hzpxj_maxno) + 1))
Case "绿药膏现金"
If lygxj_maxno = "9999999" Then
MsgBox "编号已经饱和,请全部删除", vbOKOnly + vbCritical, "错误"
Combo1(0).RemoveItem Combo1(0).ListIndex
Exit Sub
End If
ss = Trim(Str(Val(lygxj_maxno) + 1))
Case "美发收据"
If mfsj_maxno = "9999999" Then
MsgBox "编号已经饱和,请全部删除", vbOKOnly + vbCritical, "错误"
Combo1(0).RemoveItem Combo1(0).ListIndex
Exit Sub
End If
ss = Trim(Str(Val(mfsj_maxno) + 1))
Case "美发现金"
If mfxj_maxno = "9999999" Then
MsgBox "编号已经饱和,请全部删除", vbOKOnly + vbCritical, "错误"
Combo1(0).RemoveItem Combo1(0).ListIndex
Exit Sub
End If
ss = Trim(Str(Val(mfxj_maxno) + 1))
End Select
nn = Len(ss)
ssss = ""
For i = 1 To 7 - nn
ssss = "0" + ssss
Next i
Label3(1) = ssss + ss
Else
End If
End Sub
Private Sub Command1_Click(Index As Integer)
'增加时的编号还未考虑
On Error GoTo jgqerr
Select Case Index
Case 0 '...
'Me.Hide
If Left(Combo1(0), 3) = "化妆品" Then
frm_hzpxz.Show 1
Else
Load frm_zdxz
If Left(Combo1(0), 2) = "美发" Then
frm_zdxz.Combo1.Clear
frm_zdxz.Combo1.AddItem "美发"
frm_zdxz.Combo1.ListIndex = 0
End If
frm_zdxz.Caption = frm_zdxz.Caption + "(单次处置)"
frm_zdxz.Show 1
End If
Case 1 '取消
Unload Me
'frm_dcczgl.Show
Case 2 '确定
If Check1.Value Then
Set rec = db.OpenRecordset("select * from 经理表 where 密码='" + Text4 + "'")
If rec.EOF And rec.BOF Then
MsgBox "经理密码输入错误", vbOKOnly + vbCritical, "错误"
Exit Sub
End If
End If
If Combo1(0) = "" Then
MsgBox "类别为空,您不能进行单次登记", vbOKOnly + vbCritical, "错误"
Combo1(0).SetFocus
Exit Sub
End If
If Trim(Text1(0)) = "" Then
MsgBox "您没有输入客户姓名", vbOKOnly + vbCritical, "错误"
Text1(0).SetFocus
Exit Sub
End If
If IsNumeric(Text1(1)) = False Then
MsgBox "您输入的年龄有误(0)", vbOKOnly + vbCritical, "错误"
Exit Sub
Text1(1).SetFocus
End If
If Trim(Text1(3)) = "" Then
MsgBox "您没有输入项目", vbOKOnly + vbCritical, "错误"
Text1(3).SetFocus
Exit Sub
End If
If Val(Text1(4)) < 0 Then
MsgBox "您输入的金额有误(0)", vbOKOnly + vbCritical, "错误"
Text1(2).SetFocus
Exit Sub
End If
If Trim(Combo1(2).Text) = "" Then
MsgBox "介绍人不能为空", vbOKOnly + vbCritical, "错误"
Combo1(2).SetFocus
Exit Sub
End If
Set rec = db.OpenRecordset("单次处置表")
rec.AddNew
rec.Fields("日期") = Date
rec.Fields("编号") = Label3(1)
rec.Fields("姓名") = Trim(Text1(0))
rec.Fields("性别") = IIf(Option1(0).Value, "男", "女")
rec.Fields("年龄") = UpDown1.Value
rec.Fields("项目") = Trim(Text1(3))
rec.Fields("收入") = Val(Text1(4))
rec.Fields("收款员") = Label3(7)
If Combo1(1).Visible Then
rec.Fields("美容师") = Combo1(1).Text
Else
rec.Fields("美容师") = ""
End If
rec.Fields("类别") = Combo1(0).Text
rec.Fields("备注") = Trim(Text1(6))
rec.Update
Set rec = db.OpenRecordset("收入表")
rec.AddNew
rec.Fields("日期") = Date
rec.Fields("卡号") = Null
rec.Fields("项目") = Trim(Text1(3))
rec.Fields("介绍人") = Combo1(2).Text
rec.Fields("客人姓名") = Trim(Text1(0))
rec.Fields("收入") = Val(Text1(4))
rec.Fields("支付方式") = Right(Combo1(0), 2)
rec.Fields("备注") = Trim(Text1(6))
rec.Update
Select Case Combo1(0).Text
Case "单次收据"
dcsj_maxno = Trim(Str(Val(dcsj_maxno) + 1))
Case "单次现金"
dcxj_maxno = Trim(Str(Val(dcxj_maxno) + 1))
Case "化妆品收据"
hzpsj_maxno = Trim(Str(Val(hzpsj_maxno) + 1))
Case "化妆品现金"
hzpxj_maxno = Trim(Str(Val(hzpxj_maxno) + 1))
Case "美发收据"
mfsj_maxno = Trim(Str(Val(mfsj_maxno) + 1))
Case "美发现金"
mfxj_maxno = Trim(Str(Val(mfxj_maxno) + 1))
Case "绿药膏现金"
lygxj_maxno = Trim(Str(Val(lygxj_maxno) + 1))
End Select
frm_dcczgl.ss
For i = 0 To frm_dcczgl.Combo1.ListCount - 1
If frm_dcczgl.Combo1.List(i) = Combo1(0).Text Then
frm_dcczgl.Combo1.ListIndex = i
Exit For
End If
Next i
For i = 0 To frm_dcczgl.List1.ListCount - 1
If frm_dcczgl.List1.List(i) = Trim(Text1(3)) Then
frm_dcczgl.List1.ListIndex = i
Exit For
End If
Next i
For i = 0 To frm_dcczgl.List2.ListCount - 1
If frm_dcczgl.List2.List(i) = Label3(1) + "-" + Trim(Text1(0)) Then
frm_dcczgl.List2.ListIndex = i
Exit For
End If
Next i
Unload Me
'frm_dcczgl.Show
MsgBox "单次登记成功", vbOKOnly + vbInformation, "提示"
End Select
Exit Sub
jgqerr:
MsgBox Err.Description, vbOKOnly + vbCritical, "错误"
End Sub
Private Sub Form_Load()
'Set db = OpenDatabase(AppPath + "datas\mry.mdb")
Combo1(0).ListIndex = 0
Label3(0) = Format(Date, "yyyy-mm-dd")
Label3(1) = "0003911" '编号
Text1(1) = "23"
UpDown1.Value = Val(Text1(1))
Text1(5) = "10.00"
Label3(7) = Pczy
Combo1(2).AddItem Pczy
Set rec = db.OpenRecordset("美容师人员表")
Do While Not rec.EOF
Combo1(1).AddItem rec.Fields("姓名")
Combo1(2).AddItem rec.Fields("姓名")
rec.MoveNext
Loop
If Combo1(1).ListCount <> 0 Then
Combo1(1).ListIndex = 0
End If
Combo1_Click 0
Text1(2) = "0.00"
Combo1(2).ListIndex = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
'db.Close
'Set db = Nothing
End Sub
Private Sub Text1_Change(Index As Integer)
If IsNumeric(Text1(5)) Then
If Index = 2 Then
Text1(4) = Round(Val(Text1(2)) * Val(Text1(5)) / 10, 2)
End If
End If
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Text1(Index).SelStart = 0
Text1(Index).SelLength = Len(Text1(Index))
'Text1(Index).IMEMode = 1
End Sub
Private Sub Text1_LostFocus(Index As Integer)
If IsNumeric(Text1(2)) And IsNumeric(Text1(5)) Then
Else
MsgBox "你输入的金额或打折数有误", vbOKOnly + vbCritical, "错误"
Text1(2).SetFocus
Exit Sub
End If
If Index = 2 Then
Text1(4) = Round(Val(Text1(2)) * Val(Text1(5)) / 10)
End If
If Index = 5 Then
Text1(4) = Round(Val(Text1(2)) * Val(Text1(5)) / 10)
If Round(Val(Text1(5)), 0) = 10 Then
Else
If Round(Val(Text1(5)), 0) = 7 Then
Text1(6) = "本院七折"
Else
Text1(6) = "打" + Text1(5) + "折"
End If
End If
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -