?? 退貨返廠查詢.frm
字號:
VERSION 5.00
Begin VB.Form main_cxtj_rktdcx
BorderStyle = 3 'Fixed Dialog
Caption = "查詢統(tǒng)計——【退貨返廠查詢】"
ClientHeight = 4785
ClientLeft = 345
ClientTop = 2400
ClientWidth = 11280
Icon = "退貨返廠查詢.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4785
ScaleWidth = 11280
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Caption = "刪除"
Height = 435
Left = 8670
TabIndex = 8
Top = 240
Width = 1245
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 435
Left = 9930
TabIndex = 6
Top = 240
Width = 1245
End
Begin VB.CommandButton Command1
Caption = "查詢"
Height = 435
Left = 7410
TabIndex = 5
Top = 240
Width = 1245
End
Begin VB.Frame Frame2
Caption = "Frame2"
Height = 1650
Left = -465
TabIndex = 4
Top = 2130
Visible = 0 'False
Width = 1320
Begin VB.TextBox rq2
Height = 270
Left = 90
TabIndex = 10
Top = 1140
Width = 1035
End
Begin VB.TextBox rq1
Height = 270
Left = 90
TabIndex = 9
Top = 855
Width = 1035
End
Begin VB.Data Data2
Caption = "Data2"
Connect = "Access"
DatabaseName = "E:\明日vb編程500例\實用程序10例\醫(yī)藥門店版\yyjxc.mdb"
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 90
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "rktd"
Top = 495
Width = 1140
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "E:\明日vb編程500例\實用程序10例\醫(yī)藥門店版\yyjxc.mdb"
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 90
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "rktd"
Top = 180
Width = 1140
End
End
Begin VB.PictureBox DBGrid1
Height = 3615
Left = 45
ScaleHeight = 3555
ScaleWidth = 11115
TabIndex = 3
Top = 750
Width = 11175
End
Begin VB.Frame Frame1
Caption = "請選擇查詢條件"
Height = 630
Left = 60
TabIndex = 0
Top = 75
Width = 7275
Begin VB.ComboBox Combo2
Height = 300
ItemData = "退貨返廠查詢.frx":000C
Left = 2100
List = "退貨返廠查詢.frx":000E
Style = 2 'Dropdown List
TabIndex = 14
Top = 210
Width = 930
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "退貨返廠查詢.frx":0010
Left = 120
List = "退貨返廠查詢.frx":0012
Style = 2 'Dropdown List
TabIndex = 2
Top = 210
Width = 1965
End
Begin VB.TextBox Text1
BackColor = &H80000000&
Height = 300
Left = 3060
TabIndex = 1
Top = 210
Width = 4125
End
End
Begin VB.Label hjje
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 180
Left = 5520
TabIndex = 13
Top = 4485
Width = 2775
End
Begin VB.Label hjsl
BackStyle = 0 'Transparent
ForeColor = &H0000C000&
Height = 180
Left = 2835
TabIndex = 12
Top = 4485
Width = 1740
End
Begin VB.Label pz
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 180
Left = 600
TabIndex = 11
Top = 4485
Width = 1185
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "品種: 合計數(shù)量: 合計金額: 元"
Height = 255
Left = 45
TabIndex = 7
Top = 4485
Width = 8655
End
End
Attribute VB_Name = "main_cxtj_rktdcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Activate()
' 向combo1添加查詢項目列表
Combo1.AddItem ("商品名稱")
Combo1.AddItem ("批號")
Combo1.AddItem ("產(chǎn)地")
Combo1.AddItem ("規(guī)格")
Combo1.AddItem ("包裝")
Combo1.AddItem ("供應(yīng)商")
Combo1.AddItem ("票號")
' 向combo2添加查詢條件列表
Combo2.AddItem ("like")
Combo2.AddItem ("=")
Combo2.AddItem (">")
Combo2.AddItem ("<")
Combo1.ListIndex = 1
Combo2.ListIndex = 0
Data1.RecordSource = "select * from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + "))"
Data1.Refresh
Data2.RecordSource = "select count(*)as 品種,sum(數(shù)量)as 合計數(shù)量,sum(金額)as 合計金額 from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + "))"
Data2.Refresh
If Data2.Recordset(0) <> "" Then pz.Caption = Data2.Recordset(0) Else pz.Caption = "0"
If Data2.Recordset(1) <> "" Then hjsl.Caption = Data2.Recordset(1) Else hjsl.Caption = "0"
If Data2.Recordset(2) <> "" Then hjje.Caption = Data2.Recordset(2) Else hjje.Caption = "0"
End Sub
Private Sub Form_Load()
' 自動識別數(shù)據(jù)庫路徑
Data1.DatabaseName = App.Path & "\yyjxc.mdb"
Data2.DatabaseName = App.Path & "\yyjxc.mdb"
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub Command1_Click()
'查詢統(tǒng)計入庫退貨信息
Select Case Combo2.Text
Case Is = "like"
Data1.RecordSource = "select * from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + ")and(rktd." & Combo1.Text & " " & "like " + Chr(34) + "*" + Text1.Text + "*" + Chr(34) + "))"
Data1.Refresh
Data2.RecordSource = "select count(*)as 品種,sum(數(shù)量)as 合計數(shù)量,sum(金額)as 合計金額 from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + ")and(rktd." & Combo1.Text & " " & "like " + Chr(34) + "*" + Text1.Text + "*" + Chr(34) + "))"
Data2.Refresh
Case Is = "="
Data1.RecordSource = "select * from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + ")and(rktd." & Combo1.Text & " " & "like " + Chr(34) + Text1.Text + Chr(34) + "))"
Data1.Refresh
Data2.RecordSource = "select count(*)as 品種,sum(數(shù)量)as 合計數(shù)量,sum(金額)as 合計金額 from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + ")and(rktd." & Combo1.Text & " " & "like " + Chr(34) + Text1.Text + Chr(34) + "))"
Data2.Refresh
Case Is = ">"
Data1.RecordSource = "select * from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + ")and(rktd." & Combo1.Text & " " & "like " + Chr(34) + Text1.Text + "*" + Chr(34) + "))"
Data1.Refresh
Data2.RecordSource = "select count(*)as 品種,sum(數(shù)量)as 合計數(shù)量,sum(金額)as 合計金額 from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + ")and(rktd." & Combo1.Text & " " & "like " + Chr(34) + Text1.Text + "*" + Chr(34) + "))"
Data2.Refresh
Case Is = "<"
Data1.RecordSource = "select * from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + ")and(rktd." & Combo1.Text & " " & "like " + Chr(34) + "*" + Text1.Text + Chr(34) + "))"
Data1.Refresh
Data2.RecordSource = "select count(*)as 品種,sum(數(shù)量)as 合計數(shù)量,sum(金額)as 合計金額 from rktd where ((rktd.日期 between " + Chr(35) + rq1.Text + Chr(35) + "and " + Chr(35) + rq2.Text + Chr(35) + ")and(rktd." & Combo1.Text & " " & "like " + Chr(34) + "*" + Text1.Text + Chr(34) + "))"
Data2.Refresh
End Select
If Data2.Recordset(0) <> "" Then pz.Caption = Data2.Recordset(0) Else pz.Caption = "0"
If Data2.Recordset(1) <> "" Then hjsl.Caption = Data2.Recordset(1) Else hjsl.Caption = "0"
If Data2.Recordset(2) <> "" Then hjje.Caption = Data2.Recordset(2) Else hjje.Caption = "0"
End Sub
Private Sub Command2_Click()
'刪除入庫退貨信息
On Error Resume Next
Data1.Recordset.Delete
Data1.Refresh
Data2.Refresh
If Data2.Recordset(0) <> "" Then pz.Caption = Data2.Recordset(0) Else pz.Caption = "0"
If Data2.Recordset(1) <> "" Then hjsl.Caption = Data2.Recordset(1) Else hjsl.Caption = "0"
If Data2.Recordset(2) <> "" Then hjje.Caption = Data2.Recordset(2) Else hjje.Caption = "0"
End Sub
Private Sub Command3_Click()
frm_main.Enabled = True
Unload Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -