📄 frmfhhz.frm
字号:
End
Begin VB.Label Label7
Caption = "月"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 7560
TabIndex = 13
Top = 480
Width = 255
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
ForeColor = &H00FF0000&
Height = 255
Left = 4680
TabIndex = 12
Top = 480
Width = 255
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
ForeColor = &H00FF0000&
Height = 255
Left = 3840
TabIndex = 11
Top = 480
Width = 255
End
Begin VB.Label Label3
Caption = "汇总结束日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 5160
TabIndex = 10
Top = 480
Width = 1695
End
Begin VB.Label Label2
BackColor = &H8000000B&
Caption = "汇总开始日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 1560
TabIndex = 9
Top = 480
Width = 1695
End
End
Attribute VB_Name = "frmfhhz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo a
DefaultType = dbUseODBC
Dim db As Database
Dim wk As Workspace
Dim sql As String
Dim str As String
Dim str1 As String
Dim str2 As String
Dim str3 As String
Dim str4 As String
str = "fdk" & seekyearouthz.Combo1.Text
Set wk = DBEngine.Workspaces(0)
Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
If comfirmonth.Text = "" Or comfirday.Text = "" Or comendmonth.Text = "" Or comendday.Text = "" Then
MsgBox "起止日期不能为空,请填写日期!"
Command2.SetFocus
Else
If txtid = "" Then
str1 = "select 产品编号,sum(数量) as 出货数量"
str2 = " from [" + str + "] where"
str3 = " [发货单日期]>=cdate('" + seekyearouthz.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
str4 = " and [发货单日期]<=cdate('" + seekyearouthz.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + " ') group by [产品编号]"
sql = str1 + str2 + str3 + str4
Data1.RecordSource = sql
Data1.Refresh
Else
str1 = "select 产品编号,sum(数量) as 出货数量"
str2 = " from [" + str + "] where 发货=true and 产品编号='" + txtid.Text + "'"
str3 = " and [发货单日期]>=cdate('" + seekyearouthz.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
str4 = " and [发货单日期]<=cdate('" + seekyearouthz.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + " ') group by [产品编号]"
sql = str1 + str2 + str3 + str4
Data1.RecordSource = sql
Data1.Refresh
End If
End If
db.Close
a:
If Err.Number = 3146 Then
MsgBox "起止日期有误,请重新输入!"
End If
End Sub
Private Sub Command2_Click()
Unload Me
frmmenu.Show
End Sub
Private Sub Command3_Click()
On Error GoTo a
DefaultType = dbUseODBC
Dim db As Database
Dim rs1 As Recordset
Dim wk As Workspace
Dim sql As String
Dim str As String
Dim str1 As String
Dim str2 As String
str = "fdk" & seekyearouthz.Combo1.Text
Set wk = DBEngine.Workspaces(0)
Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
wk.BeginTrans
If comfirmonth.Text = "" Or comfirday.Text = "" Or comendmonth.Text = "" Or comendday.Text = "" Then
MsgBox "起止日期不能为空,请填写日期!"
Command2.SetFocus
Else
CommonDialog1.ShowPrinter
Printer.Orientation = vbPRORPortrait
Printer.PaperSize = vbPRPSA4
Printer.ScaleMode = vbMillimeters
Printer.FontName = "宋体"
Printer.FontSize = 18
str1 = "select 产品编号,sum(数量) as 出货数量"
str2 = " from [" + str + "] where"
str3 = " [发货单日期]>=cdate('" + seekyearouthz.Combo1.Text & " - " & comfirmonth.Text & " - " & comfirday.Text + "')"
str4 = " and [发货单日期]<=cdate('" + seekyearouthz.Combo1.Text & " - " & comendmonth.Text & " - " & comendday.Text + " ') group by [产品编号]"
sql = str1 + str2 + str3 + str4
Set rs1 = db.OpenRecordset(sql, dbOpenDynaset, dbwrite, dbOptimistic)
rs1.MoveFirst
Printer.CurrentX = 50
Printer.CurrentY = 15
Printer.Print "扬州市兴盛牙刷厂发货分类统计"
Printer.Line (50, 22)-(140, 22)
Printer.Line (50, 23)-(140, 23)
rs1.MoveFirst
Printer.FontSize = 10
Printer.CurrentX = 29
Printer.CurrentY = 42
Printer.Line (29.5, 41.5)-(120, 41.5)
Printer.Line (30, 42)-(30, 47)
Printer.CurrentX = 31
Printer.CurrentY = 42
Printer.Print " 产品型号"
Printer.CurrentX = 55
Printer.CurrentY = 42
Printer.Line (56, 42)-(56, 47)
Printer.CurrentX = 62
Printer.CurrentY = 42
Printer.Print " 出货数量(箱) "
Printer.CurrentX = 120
Printer.CurrentY = 42
Printer.Line (120, 42)-(120, 47)
Printer.Line (29.5, 47)-(120, 47)
CurrentY = 47
Do While rs1.EOF <> True
1 Printer.FontSize = 10
CurrentX = 29.75
Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
CurrentX = CurrentX + 1
Printer.CurrentX = CurrentX
Printer.CurrentY = CurrentY + 1
Printer.Print rs1.Fields("产品编号")
CurrentX = CurrentX + 25
Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
CurrentX = CurrentX + 1
Printer.CurrentX = CurrentX
Printer.CurrentY = CurrentY + 1
Printer.Print rs1.Fields("出货数量")
CurrentX = 120
Printer.Line (CurrentX, CurrentY)-(CurrentX, CurrentY + 5)
CurrentY = CurrentY + 5
Printer.Line (29.5, CurrentY)-(120, CurrentY)
rs1.MoveNext
If CurrentY >= 250 Then
Printer.NewPage
CurrentY = 15
Printer.Line (30, CurrentY)-(120, CurrentY)
GoTo 1
End If
If rs1.EOF = True Then
Exit Do
End If
Loop
Printer.EndDoc
rs1.Close
End If
wk.CommitTrans
db.Close
a:
If Err.Number = 3146 Then
MsgBox "起止日期有误,请重新输入!"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -