?? frmbuyall.frm
字號(hào):
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid8
Height = 1935
Left = 120
TabIndex = 40
Top = 3240
Width = 6855
_ExtentX = 12091
_ExtentY = 3413
_Version = 393216
AllowUpdate = 0 'False
BackColor = 8438015
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
Begin VB.Label Label4
Caption = "進(jìn)貨總金額:"
Height = 255
Left = 2280
TabIndex = 36
Top = 6000
Width = 1095
End
Begin VB.Label Label1
Caption = "進(jìn)貨總金額:"
Height = 495
Left = -72720
TabIndex = 33
Top = 6000
Width = 1215
End
Begin VB.Label Label2
Caption = "進(jìn)貨總金額:"
Height = 255
Left = -72720
TabIndex = 32
Top = 6000
Width = 1095
End
Begin VB.Label Label3
Caption = "進(jìn)貨總金額:"
Height = 495
Left = -72720
TabIndex = 31
Top = 6000
Width = 1215
End
End
End
Attribute VB_Name = "frmBuyall"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim inty As Integer
Dim intm As Integer
Dim intd As Integer
Private Sub Command1_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command10_Click()
If Adodc2.Recordset.EOF = True Then
MsgBox "已是末記錄!", vbOKOnly + vbInformation, "注意"
Adodc2.Recordset.MoveLast
Else
Adodc2.Recordset.MoveNext
End If
End Sub
Private Sub Command11_Click()
If Adodc2.Recordset.BOF = True Then
MsgBox "已是首記錄!", vbOKOnly + vbInformation, "注意"
Adodc2.Recordset.MoveFirst
Else
Adodc2.Recordset.MovePrevious
End If
End Sub
Private Sub Command12_Click()
Adodc2.Recordset.MoveLast
End Sub
Private Sub Command13_Click()
Adodc6.Recordset.MoveFirst
End Sub
Private Sub Command14_Click()
If Adodc6.Recordset.EOF = True Then
MsgBox "已是末記錄!", vbOKOnly + vbInformation, "注意"
Adodc6.Recordset.MoveLast
Else
Adodc6.Recordset.MoveNext
End If
End Sub
Private Sub Command15_Click()
If Adodc6.Recordset.BOF = True Then
MsgBox "已是首記錄!", vbOKOnly + vbInformation, "注意"
Adodc6.Recordset.MoveFirst
Else
Adodc6.Recordset.MovePrevious
End If
End Sub
Private Sub Command16_Click()
Adodc6.Recordset.MoveLast
End Sub
Private Sub Command17_Click()
Adodc3.Recordset.MoveFirst
End Sub
Private Sub Command18_Click()
If Adodc3.Recordset.EOF = True Then
MsgBox "已是末記錄!", vbOKOnly + vbInformation, "注意"
Adodc3.Recordset.MoveLast
Else
Adodc3.Recordset.MoveNext
End If
End Sub
Private Sub Command19_Click()
If Adodc3.Recordset.BOF = True Then
MsgBox "已是首記錄!", vbOKOnly + vbInformation, "注意"
Adodc3.Recordset.MoveFirst
Else
Adodc3.Recordset.MovePrevious
End If
End Sub
Private Sub Command2_Click()
If Adodc1.Recordset.EOF = True Then
MsgBox "已是末記錄!", vbOKOnly + vbInformation, "注意"
Adodc1.Recordset.MoveLast
Else
Adodc1.Recordset.MoveNext
End If
End Sub
Private Sub Command20_Click()
Adodc3.Recordset.MoveLast
End Sub
Private Sub Command21_Click()
Adodc7.Recordset.MoveFirst
End Sub
Private Sub Command22_Click()
If Adodc7.Recordset.EOF = True Then
MsgBox "已是末記錄!", vbOKOnly + vbInformation, "注意"
Adodc7.Recordset.MoveLast
Else
Adodc7.Recordset.MoveNext
End If
End Sub
Private Sub Command23_Click()
If Adodc7.Recordset.BOF = True Then
MsgBox "已是首記錄!", vbOKOnly + vbInformation, "注意"
Adodc7.Recordset.MoveFirst
Else
Adodc7.Recordset.MovePrevious
End If
End Sub
Private Sub Command24_Click()
Adodc7.Recordset.MoveLast
End Sub
Private Sub Command25_Click()
Adodc4.Recordset.MoveFirst
End Sub
Private Sub Command26_Click()
If Adodc4.Recordset.EOF = True Then
MsgBox "已是末記錄!", vbOKOnly + vbInformation, "注意"
Adodc4.Recordset.MoveLast
Else
Adodc4.Recordset.MoveNext
End If
End Sub
Private Sub Command27_Click()
If Adodc4.Recordset.BOF = True Then
MsgBox "已是首記錄!", vbOKOnly + vbInformation, "注意"
Adodc4.Recordset.MoveFirst
Else
Adodc4.Recordset.MovePrevious
End If
End Sub
Private Sub Command28_Click()
Adodc4.Recordset.MoveLast
End Sub
Private Sub Command29_Click()
Adodc8.Recordset.MoveFirst
End Sub
Private Sub Command3_Click()
If Adodc1.Recordset.BOF = True Then
MsgBox "已是首記錄!", vbOKOnly + vbInformation, "注意"
Adodc1.Recordset.MoveFirst
Else
Adodc1.Recordset.MovePrevious
End If
End Sub
Private Sub Command30_Click()
If Adodc8.Recordset.EOF = True Then
MsgBox "已是末記錄!", vbOKOnly + vbInformation, "注意"
Adodc8.Recordset.MoveLast
Else
Adodc8.Recordset.MoveNext
End If
End Sub
Private Sub Command31_Click()
If Adodc8.Recordset.BOF = True Then
MsgBox "已是首記錄!", vbOKOnly + vbInformation, "注意"
Adodc8.Recordset.MoveFirst
Else
Adodc8.Recordset.MovePrevious
End If
End Sub
Private Sub Command32_Click()
Adodc8.Recordset.MoveLast
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.MoveLast
End Sub
Private Sub Command5_Click()
Adodc5.Recordset.MoveFirst
End Sub
Private Sub Command6_Click()
If Adodc5.Recordset.EOF = True Then
MsgBox "已是末記錄!", vbOKOnly + vbInformation, "注意"
Adodc5.Recordset.MoveLast
Else
Adodc5.Recordset.MoveNext
End If
End Sub
Private Sub Command7_Click()
If Adodc5.Recordset.BOF = True Then
MsgBox "已是首記錄!", vbOKOnly + vbInformation, "注意"
Adodc5.Recordset.MoveFirst
Else
Adodc5.Recordset.MovePrevious
End If
End Sub
Private Sub Command8_Click()
Adodc5.Recordset.MoveLast
End Sub
Private Sub Command9_Click()
Adodc2.Recordset.MoveFirst
End Sub
Private Sub Form_Load()
inty = Year(Date)
intm = Month(Date)
intd = Day(Date)
Dim str As String
str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sellsystem.mdb;"
'Adodc1的相對(duì)路徑連接
Adodc1.ConnectionString = str
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from buy where 進(jìn)貨年=" & inty & " and 進(jìn)貨月=" & intm & " and 進(jìn)貨日=" & intd & " "
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
'Adodc2的相對(duì)路徑連接
Adodc2.ConnectionString = str
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select * from buy where 進(jìn)貨年=" & inty & " and 進(jìn)貨月=" & intm & ""
Adodc2.Refresh
Set DataGrid2.DataSource = Adodc2
DataGrid2.Refresh
'Adodc3的相對(duì)路徑連接
Select Case intm
Case Is < 4
intm = 3
Case Is < 7
intm = 6
Case Is < 10
intm = 9
Case Is > 10
intm = 12
End Select
Adodc3.ConnectionString = str
Adodc3.CommandType = adCmdText
Adodc3.RecordSource = "select * from buy where 進(jìn)貨年=" & inty & " and 進(jìn)貨月 between " & (intm - 2) & " and " & intm & " "
Adodc3.Refresh
Set DataGrid3.DataSource = Adodc3
DataGrid3.Refresh
intm = Month(Date)
'Adodc4的相對(duì)路徑連接
Adodc4.ConnectionString = str
Adodc4.CommandType = adCmdText
Adodc4.RecordSource = "select * from buy where 進(jìn)貨年=" & inty & ""
Adodc4.Refresh
Set DataGrid4.DataSource = Adodc4
DataGrid4.Refresh
'Adodc5的相對(duì)路徑連接
Adodc5.ConnectionString = str
Adodc5.CommandType = adCmdText
Adodc5.RecordSource = "select 生產(chǎn)廠商,sum(總金額) as 各廠商進(jìn)貨總金額 from buy where 進(jìn)貨年=" & inty & " and 進(jìn)貨月=" & intm & " and 進(jìn)貨日=" & intd & " group by 生產(chǎn)廠商"
Adodc5.Refresh
Set DataGrid5.DataSource = Adodc5
DataGrid5.Refresh
'Adodc6的相對(duì)路徑連接
Adodc6.ConnectionString = str
Adodc6.CommandType = adCmdText
Adodc6.RecordSource = "select 生產(chǎn)廠商,sum(總金額) as 各廠商進(jìn)貨總金額 from buy where 進(jìn)貨年=" & inty & " and 進(jìn)貨月=" & intm & " group by 生產(chǎn)廠商"
Adodc6.Refresh
Set DataGrid6.DataSource = Adodc6
DataGrid6.Refresh
'Adodc7的相對(duì)路徑連接
Select Case intm
Case Is < 4
intm = 3
Case Is < 7
intm = 6
Case Is < 10
intm = 9
Case Is > 10
intm = 12
End Select
Adodc7.ConnectionString = str
Adodc7.CommandType = adCmdText
Adodc7.RecordSource = "select 生產(chǎn)廠商,sum(總金額) as 各廠商進(jìn)貨總金額 from buy where 進(jìn)貨年=" & inty & " and 進(jìn)貨月 between " & (intm - 2) & " and " & intm & " group by 生產(chǎn)廠商"
Adodc7.Refresh
Set DataGrid7.DataSource = Adodc7
DataGrid7.Refresh
intm = Month(Date)
'Adodc8 的相對(duì)路徑連接
Adodc8.ConnectionString = str
Adodc8.CommandType = adCmdText
Adodc8.RecordSource = "select 生產(chǎn)廠商,sum(總金額) as 各廠商進(jìn)貨總金額 from buy where 進(jìn)貨年=" & inty & " group by 生產(chǎn)廠商"
Adodc8.Refresh
Set DataGrid8.DataSource = Adodc8
DataGrid8.Refresh
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -