📄 收发货统计.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Object = "{00025600-0000-0000-C000-000000000046}#4.6#0"; "crystl32.ocx"
Begin VB.Form Frmsftj
BorderStyle = 1 'Fixed Single
Caption = "收发货统计"
ClientHeight = 5925
ClientLeft = 45
ClientTop = 330
ClientWidth = 7935
Icon = "收发货统计.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 5925
ScaleWidth = 7935
Begin MSComctlLib.ProgressBar Bar
Height = 150
Left = 0
TabIndex = 14
Top = 1440
Width = 7935
_ExtentX = 13996
_ExtentY = 265
_Version = 393216
Appearance = 1
End
Begin Crystal.CrystalReport Report1
Left = 4680
Top = 3480
_ExtentX = 741
_ExtentY = 741
_Version = 262150
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 5640
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 0
Visible = 0 'False
Width = 1215
End
Begin MSDBGrid.DBGrid DBGrid
Bindings = "收发货统计.frx":014A
Height = 4215
Left = 0
OleObjectBlob = "收发货统计.frx":015E
TabIndex = 7
Top = 1680
Width = 7935
End
Begin VB.CommandButton Cmdprint
Caption = "打印"
Height = 375
Left = 6480
TabIndex = 8
Top = 840
Width = 615
End
Begin VB.CommandButton Cmdexit
Caption = "退出"
Height = 375
Left = 7200
TabIndex = 6
Top = 840
Width = 615
End
Begin VB.CommandButton Cmdtj
Caption = "统计"
Height = 375
Left = 7200
TabIndex = 5
Top = 360
Width = 615
End
Begin VB.Frame Frame1
Caption = "统计条件"
Height = 1215
Left = 0
TabIndex = 0
Top = 120
Width = 7935
Begin VB.ComboBox Combobjmc
Height = 300
Left = 3960
Style = 2 'Dropdown List
TabIndex = 13
Top = 720
Width = 2415
End
Begin VB.CheckBox Chkbjmc
Caption = "备件名称"
Height = 375
Left = 2880
TabIndex = 12
Top = 720
Width = 1095
End
Begin VB.CheckBox Chktjsj
Caption = "统计时间"
Height = 255
Left = 2880
TabIndex = 11
Top = 240
Width = 1095
End
Begin VB.CheckBox Chkyhjm
Caption = "局名"
Height = 375
Left = 120
TabIndex = 10
Top = 720
Width = 735
End
Begin VB.CheckBox Chkyhsm
Caption = "省名"
Height = 255
Left = 120
TabIndex = 9
Top = 240
Width = 735
End
Begin MSComCtl2.DTPicker DTPiktjsj1
Height = 255
Left = 3960
TabIndex = 4
Top = 240
Width = 1335
_ExtentX = 2355
_ExtentY = 450
_Version = 393216
CalendarTitleBackColor= 16744576
Format = 23724033
CurrentDate = 37232
End
Begin MSComCtl2.DTPicker DTPiktjsj2
Height = 255
Left = 5640
TabIndex = 3
Top = 240
Width = 1335
_ExtentX = 2355
_ExtentY = 450
_Version = 393216
CalendarTitleBackColor= 16744576
Format = 23724033
CurrentDate = 37232
End
Begin VB.ComboBox Comboyhjm
Height = 300
Left = 960
Style = 2 'Dropdown List
TabIndex = 2
Top = 720
Width = 1935
End
Begin VB.ComboBox Comboyhsm
Height = 300
Left = 960
Style = 2 'Dropdown List
TabIndex = 1
Top = 240
Width = 1935
End
Begin VB.Line Line1
X1 = 5520
X2 = 5400
Y1 = 360
Y2 = 360
End
End
End
Attribute VB_Name = "Frmsftj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsls As Recordset
Dim sm, jm, bjmc As String
Private Sub Cmdexit_Click()
Unload Me
End Sub
Private Sub Cmdprint_Click()
'发生错误
On Error GoTo errprint
MousePointer = vbHourglass
Report1.DataFiles(0) = App.Path & "\yhsg.mdb"
Report1.ReportFileName = App.Path & "\rpt\sftj.rpt"
Report1.Formulas(0) = "tjrq='" & tjrq & "'"
MousePointer = vbDefault
Dim Msg As Integer
Msg = MsgBox("要预览吗?", vbYesNoCancel)
If Msg = vbYes Or Msg = vbNo Then
If Msg = vbNo Then
Report1.Destination = crptToPrinter
Else
Report1.Destination = crptToWindow
End If
Report1.Action = 1
End If
Exit Sub
errprint:
MousePointer = vbDefault
If err.Number = 20513 Then
MsgBox "打印机未准备好", vbOKOnly + vbCritical, "警告"
Else
errnb = err.Number
errds = err.Description
MsgBox errnb & errds, vbOKOnly
End If
End Sub
Private Sub Cmdtj_Click()
Dim tjsj1, tjsj2, strsql, strsql2 As String
Dim tjrq As String
tjrq = ""
MousePointer = vbHourglass '设置鼠标状态
'检查报表中原来是否有数据,如有全部删除
db.Execute "delete from temp_sftj"
'查询发货记录查询
tjsj1 = CStr(Format(DTPiktjsj1.Value, "yyyy-mm-dd"))
tjsj2 = CStr(Format(DTPiktjsj2.Value, "yyyy-mm-dd"))
If Chkyhsm.Value = 1 Then
If Comboyhsm.Text <> "" Then
sm = Trim(Comboyhsm.Text)
strsql = " and sm='" & sm & "'"
Else
MousePointer = vbDefault
MsgBox "统计条件省名不能为空", vbInformation, "信息"
Exit Sub
End If
Else
strsql = ""
End If
If Chkbjmc.Value = 1 Then
If Combobjmc.Text = "" Then
MousePointer = vbDefault
MsgBox "统计条件备件名称不能为空!", vbInformation, "信息"
Combobjmc.SetFocus
Exit Sub
End If
End If
If Chkyhjm.Value = 1 Then
If strsql <> "" Then
If Comboyhjm.Text <> "" Then
jm = Trim(Comboyhjm.Text)
strsql = strsql & " and jm='" & jm & "'"
Else
MousePointer = vbDefault
MsgBox "统计条件局名不能为空", vbInformation, "信息"
Exit Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -