?? frmorderstatistics.frm
字號:
Left = 225
TabIndex = 6
Top = 2850
Width = 8190
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3240
Left = 75
TabIndex = 7
Top = 150
Width = 8040
_ExtentX = 14182
_ExtentY = 5715
_Version = 393216
AllowUpdate = 0 'False
BackColor = 12648447
BorderStyle = 0
ForeColor = 16711680
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin VB.ComboBox cob月
BackColor = &H00C0FFFF&
ForeColor = &H00FF0000&
Height = 300
ItemData = "frmOrderStatistics.frx":0000
Left = 7500
List = "frmOrderStatistics.frx":0028
TabIndex = 4
Top = 975
Width = 615
End
Begin VB.TextBox txt年
BackColor = &H00C0FFFF&
ForeColor = &H00FF0000&
Height = 300
Left = 6525
Top = 975
Width = 615
End
Begin Crystal.CrystalReport CrystalReport1
Left = 0
Top = 6240
_ExtentX = 741
_ExtentY = 741
_Version = 262150
ReportFileName = "C:\SYSTEM\REPORT\sgtj.rpt"
WindowWidth = 640
WindowHeight = 480
WindowControlBox= -1 'True
WindowMaxButton = -1 'True
WindowMinButton = -1 'True
WindowState = 2
End
Begin ComctlLib.ImageList ImageList1
Left = 8160
Top = 360
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 327682
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 4
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmOrderStatistics.frx":0053
Key = ""
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmOrderStatistics.frx":036D
Key = ""
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmOrderStatistics.frx":0687
Key = ""
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmOrderStatistics.frx":09A1
Key = ""
EndProperty
EndProperty
End
Begin VB.Label Label4
Caption = "月"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Left = 8175
TabIndex = 5
Top = 1005
Width = 165
End
Begin VB.Label Label3
Caption = "年"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Left = 7275
TabIndex = 3
Top = 1005
Width = 165
End
Begin VB.Label Label2
Caption = "查詢月份"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Left = 5550
TabIndex = 1
Top = 1005
Width = 840
End
End
Attribute VB_Name = "frmOrderStatistics"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Conn As New ADODB.Connection
Dim Cmd As New ADODB.Command
'Dim rs As New ADODB.Recordset
Private Sub cmdClose_Click()
Conn.Close
Unload Me
End Sub
Private Sub cmdPreview_Click()
CrystalReport1.Destination = crptToWindow
CrystalReport1.PrintReport
End Sub
Private Sub cmdPrint_Click()
CrystalReport1.Destination = crptToPrinter
CrystalReport1.PrintReport
End Sub
Private Sub cmdSearch_Click()
Dim Sql As String
Sql = "delete * from 購貨清單審購統計"
Cmd.CommandText = Sql
Cmd.Execute
If Option1.Value = True Then
If txt起始訂單號碼.Text > txt終止訂單號碼.Text Then
MsgBox "起始訂單號碼不能大于終止訂單號碼!"
Exit Sub
End If
Sql = "select 貨品代號 as 代號,貨品品名 as 品名,貨品單價 as 單價,貨品單位積分 as 單位積分,sum(購貨數量) as 數量 from 購貨清單明細 where 訂單號碼>= '" & _
txt起始訂單號碼.Text & "' and " & "訂單號碼<= '" & txt終止訂單號碼.Text & "' group by 貨品代號,貨品品名,貨品單價,貨品單位積分"
Adodc1.RecordSource = Sql
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.ReBind
End If
If Option2.Value = True Then
Sql = "select 貨品代號 as 代號,貨品品名 as 品名,貨品單價 as 單價,貨品單位積分 as 單位積分,sum(購貨數量) as 數量 from 購貨清單明細 where 訂單號碼 in (select 訂單號碼 from 購貨清單 where 業務員工號= '" & txt員工工號.Text & "') group by 貨品代號,貨品品名,貨品單價,貨品單位積分"
Adodc1.RecordSource = Sql
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.ReBind
End If
Sql = "insert into 購貨清單審購統計 " & Sql
Cmd.CommandText = Sql
Cmd.Execute
End Sub
Private Sub Combo2_Change()
Combo2.Text = UCase(Combo2.Text)
Combo2.SelStart = Len(Combo2.Text)
txt起始訂單號碼.Text = Combo2.Text
txt終止訂單號碼.Text = Combo2.Text
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt起始訂單號碼.SetFocus
txt起始訂單號碼.SelStart = Len(txt終止訂單號碼.Text)
End If
End Sub
Private Sub Combo3_Change()
Combo3.Text = UCase(Combo3.Text)
Combo3.SelStart = Len(Combo3.Text)
txt員工工號.Text = Combo3.Text
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt員工工號.SetFocus
txt員工工號.SelStart = Len(txt員工工號.Text)
End If
End Sub
Private Sub Command2_Click()
frmSGQD_YGGH.Show 1
End Sub
Private Sub Form_Load()
Dim ConnStr As String
ConnStr = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=c:\system\database\system.mdb"
If Month(Date) = 1 Then
txt年.Text = Year(Date) - 1
Else
txt年.Text = Year(Date)
End If
If Month(Date) = 1 Then
cob月.Text = 12
Else
cob月.Text = Month(Date) - 1
End If
Option1.Value = True
Frame3.Visible = True
Option2.Value = False
Frame4.Visible = False
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=c:\system\database\system.mdb"
Conn.Open ConnStr
Set Cmd.ActiveConnection = Conn
End Sub
Private Sub Option1_Click()
Frame3.Visible = True
Frame4.Visible = False
End Sub
Private Sub Option2_Click()
Frame3.Visible = False
Frame4.Visible = True
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
Select Case Button.Key
Case "Search"
cmdSearch_Click
Case "Preview"
cmdPreview_Click
Case "Print"
cmdPrint_Click
Case "Close"
cmdClose_Click
End Select
End Sub
Private Sub txt起始訂單號碼_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt終止訂單號碼.SetFocus
txt終止訂單號碼.SelStart = Len(txt終止訂單號碼.Text)
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -