📄 rep oil dirt sale avg.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form40
BackColor = &H80000013&
Caption = "Dirt Oil Sale Average Report"
ClientHeight = 6030
ClientLeft = 60
ClientTop = 450
ClientWidth = 7395
LinkTopic = "Form40"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6030
ScaleWidth = 7395
StartUpPosition = 3 'Windows Default
Begin VB.OptionButton Option3
BackColor = &H80000013&
Caption = "From Day"
BeginProperty Font
Name = "Times New Roman"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 13
Top = 3600
Width = 1455
End
Begin VB.OptionButton Option1
BackColor = &H80000013&
Caption = "One Day"
BeginProperty Font
Name = "Times New Roman"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 12
Top = 2520
Width = 1335
End
Begin VB.OptionButton Option2
BackColor = &H80000013&
Caption = "All Dates"
BeginProperty Font
Name = "Times New Roman"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 11
Top = 1560
Width = 1815
End
Begin VB.Frame Frame1
BackColor = &H80000013&
Height = 855
Left = 240
TabIndex = 8
Top = 2280
Width = 5535
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1680
TabIndex = 9
Top = 240
Width = 1455
_ExtentX = 2566
_ExtentY = 661
_Version = 393216
Format = 64290817
CurrentDate = 38283
End
End
Begin VB.Frame Frame2
BackColor = &H80000013&
Height = 855
Left = 240
TabIndex = 4
Top = 3360
Width = 5775
Begin MSComCtl2.DTPicker DTPicker3
Height = 375
Left = 4200
TabIndex = 5
Top = 240
Width = 1455
_ExtentX = 2566
_ExtentY = 661
_Version = 393216
Format = 64290817
CurrentDate = 38283
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 375
Left = 1680
TabIndex = 6
Top = 240
Width = 1455
_ExtentX = 2566
_ExtentY = 661
_Version = 393216
Format = 64290817
CurrentDate = 38283
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "To Day"
BeginProperty Font
Name = "Times New Roman"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3360
TabIndex = 7
Top = 240
Width = 735
End
End
Begin VB.Frame Frame3
BackColor = &H80000013&
Height = 855
Left = 240
TabIndex = 3
Top = 1200
Width = 5535
End
Begin VB.Frame Frame4
BackColor = &H80000013&
Height = 735
Left = 1200
TabIndex = 0
Top = 4440
Width = 3735
Begin VB.CommandButton Command1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Caption = "Preview"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
Style = 1 'Graphical
TabIndex = 2
Top = 240
Width = 1575
End
Begin VB.CommandButton Command2
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
Caption = "Cancel"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
Style = 1 'Graphical
TabIndex = 1
Top = 240
Width = 1575
End
End
Begin VB.Image Image3
Height = 675
Left = 5720
Picture = "Rep oil dirt sale avg.frx":0000
Top = 4860
Width = 690
End
Begin VB.Label Label3
BackColor = &H80000013&
Height = 5055
Left = 6000
TabIndex = 14
Top = 0
Width = 255
End
Begin VB.Image Image2
Height = 765
Left = -950
Picture = "Rep oil dirt sale avg.frx":18DE
Top = 5420
Width = 6960
End
Begin VB.Image Image1
Height = 6120
Left = 6000
Picture = "Rep oil dirt sale avg.frx":12E70
Top = 0
Width = 1440
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "Dirt Oil Sale Average"
BeginProperty Font
Name = "Times New Roman"
Size = 20.25
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 960
TabIndex = 10
Top = 360
Width = 4215
End
End
Attribute VB_Name = "Form40"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
If Option2.Value = True Then
If rs.State = adStateOpen Then rs.Close
'/////////////////////
rs.Open "SELECT dbo.Sale_Supply_Order_Table.S_Supply_Order, dbo.Sale_Supply_Order_Table.S_Supply_Date, dbo.Sale_Supply_Order_Detail_Table.Total_Bags, dbo.Sale_Supply_Order_Detail_Table.Product_Name, dbo.Sale_Supply_Order_Detail_Table.Total_Mounds, dbo.Sale_Supply_Order_Detail_Table.[Rate/Mound] , dbo.Sale_Supply_Order_Table.Grand_Amount FROM dbo.Sale_Supply_Order_Table INNER JOIN dbo.Sale_Supply_Order_Detail_Table ON dbo.Sale_Supply_Order_Table.S_Supply_Order = dbo.Sale_Supply_Order_Detail_Table.S_Supply_Order where Sale_Supply_Order_Detail_Table.Product_Name='" & Trim("Dirt Oil") & "'", cnn, adOpenStatic, adLockReadOnly
If rs.RecordCount = 0 Then
MsgBox "Dirt Oil is not Saled so for"
Else
'////////////////////////////
Set Form16.report = New CrystalReport6
Form16.report.Database.SetDataSource rs, 3, 1
Form16.Show
End If
End If
If Option1.Value = True Then
If rs.State = adStateOpen Then rs.Close
'///////////////////
rs.Open "SELECT dbo.Sale_Supply_Order_Table.S_Supply_Order, dbo.Sale_Supply_Order_Table.S_Supply_Date, dbo.Sale_Supply_Order_Detail_Table.Total_Bags, dbo.Sale_Supply_Order_Detail_Table.Product_Name, dbo.Sale_Supply_Order_Detail_Table.Total_Mounds, dbo.Sale_Supply_Order_Detail_Table.[Rate/Mound] , dbo.Sale_Supply_Order_Table.Grand_Amount FROM dbo.Sale_Supply_Order_Table INNER JOIN dbo.Sale_Supply_Order_Detail_Table ON dbo.Sale_Supply_Order_Table.S_Supply_Order = dbo.Sale_Supply_Order_Detail_Table.S_Supply_Order where Sale_Supply_Order_Detail_Table.Product_Name='" & Trim("Dirt Oil") & "' and Sale_Supply_Order_Table.S_Supply_Date='" & DTPicker1.Value & "'", cnn, adOpenStatic, adLockReadOnly
If rs.RecordCount = 0 Then
MsgBox "Dirt Oil is not Saled on this date"
Else
'//////////////////////
Set Form16.report = New CrystalReport6
Form16.report.Database.SetDataSource rs, 3, 1
Form16.Show
End If
End If
If Option3.Value = True Then
If DTPicker2.Value > DTPicker3.Value Then
MsgBox "From Day should be less than the To Day"
Else
If rs.State = adStateOpen Then rs.Close
'//////////////////
rs.Open "SELECT dbo.Sale_Supply_Order_Table.S_Supply_Order, dbo.Sale_Supply_Order_Table.S_Supply_Date, dbo.Sale_Supply_Order_Detail_Table.Total_Bags, dbo.Sale_Supply_Order_Detail_Table.Product_Name, dbo.Sale_Supply_Order_Detail_Table.Total_Mounds, dbo.Sale_Supply_Order_Detail_Table.[Rate/Mound] , dbo.Sale_Supply_Order_Table.Grand_Amount FROM dbo.Sale_Supply_Order_Table INNER JOIN dbo.Sale_Supply_Order_Detail_Table ON dbo.Sale_Supply_Order_Table.S_Supply_Order = dbo.Sale_Supply_Order_Detail_Table.S_Supply_Order where Sale_Supply_Order_Detail_Table.Product_Name='" & Trim("Dirt Oil") & "' and Sale_Supply_Order_Table.S_Supply_Date>='" & DTPicker2.Value & "' and Sale_Supply_Order_Table.S_Supply_Date<='" & DTPicker3.Value & "'", cnn, adOpenStatic, adLockReadOnly
If rs.RecordCount = 0 Then
MsgBox "Dirt Oil is not Saled between these dates"
Else
'/////////////////////
Set Form16.report = New CrystalReport6
Form16.report.Database.SetDataSource rs, 3, 1
Form16.Show
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
If cnn.State = adStateOpen Then cnn.Close
cnn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=hussain"
'DTPicker1.Value = Now
'DTPicker2.Value = Now
'DTPicker3.Value = Now
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -