📄 frmhzname.frm
字号:
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "单号"
Object.Width = 1235
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 1
Text = "消费日期"
Object.Width = 2028
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "食品分类"
Object.Width = 1587
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "物品名称"
Object.Width = 2822
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 4
Text = "单位"
Object.Width = 1235
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 5
Text = "单价"
Object.Width = 1587
EndProperty
BeginProperty ColumnHeader(7) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 6
Text = "数量"
Object.Width = 1411
EndProperty
BeginProperty ColumnHeader(8) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 7
Text = "金额"
Object.Width = 1940
EndProperty
BeginProperty ColumnHeader(9) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 8
Text = "加工费"
Object.Width = 1587
EndProperty
BeginProperty ColumnHeader(10) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 9
Text = "总金额"
Object.Width = 2293
EndProperty
End
Begin VB.Menu mnuMenu
Caption = "控制菜单(&M)"
Begin VB.Menu mnuView
Caption = "查看消费单(&View)"
Shortcut = {F4}
End
Begin VB.Menu ddd
Caption = "-"
End
Begin VB.Menu mnuDelete
Caption = "删除消费单(&Delete)"
Shortcut = ^D
End
Begin VB.Menu asdfsdfdd
Caption = "-"
End
Begin VB.Menu mnuSearch
Caption = "详细搜索(&Search)"
Shortcut = {F3}
End
Begin VB.Menu mnuAll
Caption = "显示所有消费单(&ALL)"
Shortcut = ^A
End
Begin VB.Menu asdfsdf
Caption = "-"
End
Begin VB.Menu mnuPrint
Caption = "打印列表(&Print)"
Shortcut = {F8}
End
Begin VB.Menu eeeee
Caption = "-"
End
Begin VB.Menu mnuExit
Caption = "关闭返回(&Exit)"
Shortcut = ^X
End
End
End
Attribute VB_Name = "frmHZName"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sPubWhere As String '通用条件表达示
Private Sub chkHZ_Click()
If dtpStart.Value = dtpENd.Value Then
If IsSqlDat = True Then
RefreshGrid " Where ((lHour>=" & ftStartHour.Text & " And lHour<=" & ftEndHour.Text & ")" _
& " And (Date>='" & dtpStart.Value & "' And Date<='" & dtpENd.Value & "')) "
Else
RefreshGrid " Where ((lHour>=" & ftStartHour.Text & " And lHour<=" & ftEndHour.Text & ")" _
& " And (Date>=#" & dtpStart.Value & "# And Date<=# " & dtpENd.Value & "#)) Order By ID"
End If
Else
'日期不同时 And DDirect=" & (cmbType.ListIndex - 1) & " Order By ID"
If IsSqlDat = True Then
RefreshGrid " Where ((lHour>=" & ftStartHour.Text _
& " And Date='" & dtpStart.Value & "') OR (Date>'" & dtpStart.Value & "' And Date<'" & dtpENd.Value _
& "') Or (lHour<=" & ftEndHour.Text & " And Date='" & dtpENd.Value & "'))"
Else
'Access数据库
RefreshGrid " Where ((lHour>=" & ftStartHour.Text _
& " And Date=#" & dtpStart.Value & "#) OR (Date>#" & dtpStart.Value & "# And Date<#" & dtpENd.Value _
& "#) Or (lHour<=" & ftEndHour.Text & " And Date=#" & dtpENd.Value & "#)) Order By ID"
End If
End If
End Sub
Private Sub cmdAll_Click()
Call mnuAll_Click
End Sub
Private Sub cmdDel_Click()
Call MnuDelete_Click
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdPrint_Click()
If lstPro.ListItems.Count = 0 Then
MsgBox "没有打印内容。 ", vbExclamation
Exit Sub
End If
'打印列表
If MsgBox("真的要打印【消费单】列表吗?(Y/N) " & vbCrLf _
& "请设置打印: A4纸 纵向 ", vbInformation + vbYesNo, "www.vb-code.net") = vbNo Then
Exit Sub
End If
Dim ptGrid As listViewPrint
'建立打印对象
On Error GoTo Err1
Set ptGrid = New listViewPrint
ptGrid.N_Border = 1
ptGrid.N_Cols = "1,2,3,4,5,6,7,8,9,10"
Set ptGrid.N_Grid = lstPro
ptGrid.N_TiTle = "【消费单】"
ptGrid.N_Head10 = "制表人:" & UserText
ptGrid.N_Head2 = "时间范围:" & dtpStart.Value & " " & ftStartHour.Text & "点 - " & dtpENd.Value & " " & ftEndHour.Text & "点"
ptGrid.N_PageLeft = XLeft
ptGrid.N_PageHeight = 290
ptGrid.N_PageWidth = 200
ptGrid.N_PageTop = XTop
ptGrid.N_RowHeight = 6
ptGrid.PrintPage
Set ptGrid = Nothing
Exit Sub
Err1:
MsgBox "对不起,打印列表错误。 " & vbCrLf & vbCrLf & Err.Description, vbInformation
Exit Sub
End Sub
Private Sub cmdSearch_Click()
If dtpStart.Value = dtpENd.Value Then
If IsSqlDat = True Then
RefreshGrid " Where ((lHour>=" & ftStartHour.Text & " And lHour<=" & ftEndHour.Text & ")" _
& " And (Date>='" & dtpStart.Value & "' And Date<='" & dtpENd.Value & "')) "
Else
RefreshGrid " Where ((lHour>=" & ftStartHour.Text & " And lHour<=" & ftEndHour.Text & ")" _
& " And (Date>=#" & dtpStart.Value & "# And Date<=# " & dtpENd.Value & "#)) Order By ID"
End If
Else
'日期不同时 And DDirect=" & (cmbType.ListIndex - 1) & " Order By ID"
If IsSqlDat = True Then
RefreshGrid " Where ((lHour>=" & ftStartHour.Text _
& " And Date='" & dtpStart.Value & "') OR (Date>'" & dtpStart.Value & "' And Date<'" & dtpENd.Value _
& "') Or (lHour<=" & ftEndHour.Text & " And Date='" & dtpENd.Value & "'))"
Else
'Access数据库
RefreshGrid " Where ((lHour>=" & ftStartHour.Text _
& " And Date=#" & dtpStart.Value & "#) OR (Date>#" & dtpStart.Value & "# And Date<#" & dtpENd.Value _
& "#) Or (lHour<=" & ftEndHour.Text & " And Date=#" & dtpENd.Value & "#)) Order By ID"
End If
End If
End Sub
Private Sub dtpEnd_Change()
If dtpENd.Value < dtpStart.Value Then
dtpStart.Value = dtpENd.Value
End If
End Sub
Private Sub dtpENd_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
ftEndHour.SetFocus
End If
End Sub
Private Sub dtpStart_Change()
If dtpStart.Value > dtpENd.Value Then
dtpENd.Value = dtpStart.Value
End If
End Sub
Private Sub dtpStart_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
ftStartHour.SetFocus
End If
End Sub
Private Sub Form_Activate()
frmMain.lbControl.Caption = "按菜名汇总消费"
End Sub
Private Sub Form_Load()
HZNameFocus = True
GetFormSet Me, frmMain
dtpStart.Value = Date: dtpENd.Value = Date
If IsSqlDat = True Then
'显示今日记录
RefreshGrid " Where (lHour>=" & ftStartHour.Text & " And lHour<=" & ftEndHour.Text & ")" _
& " And (Date>='" & dtpStart.Value & "' And Date<='" & dtpENd.Value & "') "
Else
'显示今日记录
RefreshGrid " Where (lHour>=" & ftStartHour.Text & " And lHour<=" & ftEndHour.Text & ")" _
& " And (Date>=#" & dtpStart.Value & "# And Date<=# " & dtpENd.Value & "#) Order By ID DESC"
End If
End Sub
Private Sub Form_Resize()
On Error Resume Next
If Me.WindowState = 1 Then Exit Sub
'常规时
If Me.WindowState = 0 Then
Me.Move 1, 1, frmMain.Width - (frmMain.picTool.Width + 200), frmMain.Height - (frmMain.picADV.Height + 1150)
End If
Frame1.Width = Me.ScaleWidth - 180
lstPro.Left = Frame1.Left
lstPro.Width = Frame1.Width
lstPro.Height = Me.ScaleHeight - Frame1.Height - 200
cmdExit.Left = Frame1.Width - cmdExit.Width - 180
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmMain.lbControl.Caption = "收银控制中心"
HZNameFocus = False
SaveFormSet Me
End Sub
Private Sub ftEndHour_Change()
On Error Resume Next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -