📄 frmbuyst.frm
字号:
Width = 6615
_ExtentX = 11668
_ExtentY = 3413
_Version = 393216
AllowUpdate = 0 'False
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 MSDataGridLib.DataGrid DataGrid7
Bindings = "frmbuyst.frx":00EE
Height = 1935
Left = -74760
TabIndex = 13
Top = 600
Width = 6615
_ExtentX = 11668
_ExtentY = 3413
_Version = 393216
AllowUpdate = 0 'False
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 MSDataGridLib.DataGrid DataGrid8
Bindings = "frmbuyst.frx":0103
Height = 2055
Left = -74880
TabIndex = 14
Top = 2880
Width = 6735
_ExtentX = 11880
_ExtentY = 3625
_Version = 393216
AllowUpdate = 0 'False
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 = "总金额"
Height = 375
Left = -73680
TabIndex = 15
Top = 5400
Width = 1215
End
Begin VB.Label Label3
Caption = "总金额"
Height = 375
Left = -73680
TabIndex = 11
Top = 5520
Width = 1215
End
Begin VB.Label Label2
Caption = "总金额"
Height = 375
Left = -73680
TabIndex = 7
Top = 5640
Width = 1215
End
Begin VB.Label Label1
Caption = "总金额"
Height = 375
Left = 1080
TabIndex = 3
Top = 5400
Width = 1215
End
End
End
Attribute VB_Name = "frmbuyst"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub form_activate()
Call MakeCenter(Me)
Dim inty As Integer
Dim intm As Integer
Dim intd As Integer
inty = Year(Date)
intm = Month(Date)
intd = Day(Date)
Dim sqlbuy As String
Dim sqlfctotal As String
Dim sqltotal As String
Dim rs_check As New ADODB.Recordset
Dim rs_fctotal As New ADODB.Recordset
Dim rs_total As New ADODB.Recordset
rs_check.CursorLocation = adUseClient
rs_fctotal.CursorLocation = adUseClient
rs_total.CursorLocation = adUseClient
Adodc1.ConnectionString = connStr
Adodc2.ConnectionString = connStr
Adodc3.ConnectionString = connStr
Adodc4.ConnectionString = connStr
Adodc5.ConnectionString = connStr
Adodc6.ConnectionString = connStr
Adodc7.ConnectionString = connStr
Adodc8.ConnectionString = connStr
Select Case sstabbuy.Tab
Case 0
sstabbuy.TabEnabled(0) = True
sstabbuy.TabEnabled(1) = False
sstabbuy.TabEnabled(2) = False
sstabbuy.TabEnabled(3) = False
sqlbuy = "select * from goods where 进货年=" & inty _
& "and 进货月=" & intm & "and 进货日=" & intd & "order by" _
& " 生产厂商,总金额 desc"
rs_check.Open sqlbuy, conn, adOpenKeyset, adLockPessimistic
Adodc1.RecordSource = sqlbuy
Adodc1.Refresh
DataGrid1.ReBind
If rs_check.EOF = True Then
Adodc2.RecordSource = sqlbuy
Adodc2.Refresh
DataGrid2.ReBind
Text1.Text = 0
MsgBox "您今日没有进货!", vbOKOnly + vbInformation, "注意"
rs_check.Close
Exit Sub
End If
sqlfctotal = "select 生产厂商,sum(总金额) as 各厂商进货总金额 " _
& "from goods where 进货年=" & inty & "and 进货月=" & intm _
& "and 进货日=" & intd & "group by 生产厂商"
rs_fctotal.Open sqlfctotal, conn, adOpenKeyset, adLockPessimistic
Adodc2.RecordSource = sqlfctotal
Adodc2.Refresh
DataGrid2.ReBind
rs_fctotal.Close
sqltotal = "select sum(总金额) as 进货总金额 from goods where" _
& "进货年=" & inty & "and 进货月=" & intm & "and 进货日=" & intd
rs_total.Open sqlfctotal, conn, adOpenKeyset, adLockPessimistic
Text1.Text = rs_total.Fields(0)
rs_total.Close
rs_check.Close
Case 1
sstabbuy.TabEnabled(0) = False
sstabbuy.TabEnabled(1) = True
sstabbuy.TabEnabled(2) = False
sstabbuy.TabEnabled(3) = False
sqlbuy = "select * from goods where 进货年=" & inty _
& "and 进货月=" & intm & "order by 生产厂商,总金额 desc"
rs_check.Open sqlbuy, conn, adOpenKeyset, adLockPessimistic
Adodc3.RecordSource = sqlbuy
Adodc3.Refresh
DataGrid3.ReBind
If rs_check.EOF = True Then
Adodc4.RecordSource = sqlbuy
Adodc4.Refresh
DataGrid4.ReBind
Text2.Text = 0
MsgBox "您本月没有进货!", vbOKOnly + vbInformation, "注意"
rs_check.Close
Exit Sub
End If
rs_check.Close
sqlfctotal = "select 生产厂商,sum(总金额) as 各厂商进货总金额" _
& "from goods where 进货年=" & inty & "and 进货月=" & intm _
& "group by 生产厂商"
rs_fctotal.Open sqlfctotal, conn, adOpenKeyset, adLockPessimistic
Adodc4.RecordSource = sqlfctotal
Adodc4.Refresh
DataGrid4.ReBind
rs_fctotal.Close
sqltotal = "select sum(总金额) as 进货总金额 from goods where" _
& "进货年=" & inty & "and 进货月=" & intm
rs_total.Open sqlfctotal, conn, adOpenKeyset, adLockPessimistic
Text2.Text = rs_total.Fields(0)
rs_total.Close
Case 2
sstabbuy.TabEnabled(0) = False
sstabbuy.TabEnabled(1) = False
sstabbuy.TabEnabled(2) = True
sstabbuy.TabEnabled(3) = False
Dim a As Integer
s = intm Mod 3
If s = 0 Then s = 3
sqlbuy = "select * from goods where 进货年=" & inty _
& "and 进货月 between" & (intm - s) & "and" & (intm + 1) _
& "order by 生产厂商,总金额 desc"
rs_check.Open sqlbuy, conn, adOpenKeyset, adLockPessimistic
Adodc5.RecordSource = sqlbuy
Adodc5.Refresh
DataGrid5.ReBind
If rs_check.EOF = True Then
Adodc6.RecordSource = sqlbuy
Adodc6.Refresh
DataGrid6.ReBind
MsgBox "您本季度没有进货!", vbOKOnly + vbInformation, "注意"
rs_check.Close
Exit Sub
End If
rs_check.Close
sqlfctotal = "select 生产厂商,sum(总金额) as 各厂商进货总金额" _
& "from goods where 进货年=" & inty & "and 进货月 between" _
& (intm - s) & "and" & intm & "group by 生产厂商"
rs_fctotal.Open sqlfctotal, conn, adOpenKeyset, adLockPessimistic
Adodc6.RecordSource = sqlfctotal
Adodc6.Refresh
DataGrid6.ReBind
rs_fctotal.Close
sqltotal = "select sum(总金额) as 进货总金额 from goods where" _
& "进货年=" & inty & "and 进货月 between" & (intm - s) & "and" & intm
rs_total.Open sqlfctotal, conn, adOpenKeyset, adLockPessimistic
Text3.Text = rs_total.Fields(0)
rs_total.Close
Case 3
sstabbuy.TabEnabled(0) = False
sstabbuy.TabEnabled(1) = False
sstabbuy.TabEnabled(2) = False
sstabbuy.TabEnabled(3) = True
sqlbuy = "select * from goods where 进货年=" & inty _
& "order by 生产厂商,总金额 desc"
rs_check.Open sqlbuy, conn, adOpenKeyset, adLockPessimistic
Adodc7.RecordSource = sqlbuy
Adodc7.Refresh
DataGrid7.ReBind
If rs_check.EOF = True Then
Adodc8.RecordSource = sqlbuy
Adodc8.Refresh
DataGrid8.ReBind
Text3.Text = 0
MsgBox "您本年没有进货!", vbOKOnly + vbInformation, "注意"
rs_check.Close
Exit Sub
End If
rs_check.Close
sqlfctotal = "select 生产厂商,sum(总金额) as 各厂商进货总金额" _
& "from goods where 进货年=" & inty & "group by 生产厂商"
rs_fctotal.Open sqlfctotal, conn, adOpenKeyset, adLockPessimistic
Adodc8.RecordSource = sqlfctotal
Adodc8.Refresh
DataGrid8.ReBind
rs_fctotal.Close
sqltotal = "select sum(总金额) as 进货总金额 from goods where" _
& "进货年=" & intm
rs_total.Open sqlfctotal, conn, adOpenKeyset, adLockPessimistic
Text4.Text = rs_total.Fields(0)
rs_total.Close
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -