?? frmmain.frm
字號:
VERSION 5.00
Begin VB.Form frmMain
BorderStyle = 4 'Fixed ToolWindow
Caption = "超市管理界面"
ClientHeight = 8730
ClientLeft = 150
ClientTop = 720
ClientWidth = 11880
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmMain.frx":0000
ScaleHeight = 8730
ScaleWidth = 11880
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
WindowState = 2 'Maximized
Begin VB.Menu mnjiaoyi
Caption = "交易管理"
Begin VB.Menu mnBuy
Caption = "進貨登記"
End
Begin VB.Menu mnSell
Caption = "銷售登記"
End
Begin VB.Menu mnRetreat
Caption = "退貨登記"
End
End
Begin VB.Menu mnBuyAll
Caption = "進貨統(tǒng)計"
Begin VB.Menu mnBuyToday
Caption = "今日進貨統(tǒng)計"
End
Begin VB.Menu mnBuyMonth
Caption = "本月進貨統(tǒng)計"
End
Begin VB.Menu mnBuyQuarterly
Caption = "本季度進貨統(tǒng)計"
End
Begin VB.Menu mnBuyYear
Caption = "今年進貨統(tǒng)計"
End
End
Begin VB.Menu mnSellAll
Caption = "銷售統(tǒng)計"
Begin VB.Menu mnSellToday
Caption = "今日銷售統(tǒng)計"
End
Begin VB.Menu mnSellMonth
Caption = "本月銷售統(tǒng)計"
End
Begin VB.Menu mnSellQuarterly
Caption = "本季度銷售統(tǒng)計"
End
Begin VB.Menu mnSellYear
Caption = "今年銷售統(tǒng)計"
End
End
Begin VB.Menu mnTable
Caption = "查看數(shù)據(jù)表"
Begin VB.Menu mnBuyTable
Caption = "查看進貨表"
End
Begin VB.Menu mnGoodsTable
Caption = "查看現(xiàn)存商品表"
End
Begin VB.Menu mnSellTable
Caption = "查看銷售表"
End
Begin VB.Menu mnRetreatTable
Caption = "查看退貨表"
End
Begin VB.Menu mnEmployeeTable
Caption = "管理員工表"
End
Begin VB.Menu mnManufacturerTable
Caption = "查看進貨商表"
End
End
Begin VB.Menu mnxitong
Caption = "系統(tǒng)管理"
Begin VB.Menu mnChangeEmployee
Caption = "更換用戶"
End
Begin VB.Menu mnChangePwd
Caption = "修改密碼"
End
Begin VB.Menu mnExit
Caption = "退出系統(tǒng)"
End
Begin VB.Menu mnabout
Caption = "關(guān)于"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs_sell As New ADODB.Recordset
Dim rs_goods As New ADODB.Recordset
Dim rs_buy As New ADODB.Recordset
Dim rs_retreat As New ADODB.Recordset
Dim rs_manufacturer As New ADODB.Recordset
Dim rs_employee As New ADODB.Recordset
Dim rs_fctotal As New ADODB.Recordset
Dim rs_total As New ADODB.Recordset
Dim strsell As String
Dim strgoods As String
Dim strbuy As String
Dim strretreat As String
Dim strmanufacturer As String
Dim stremployee As String
Dim strfctotal As String
Dim strtotal As String
Dim inty As Integer
Dim intm As Integer
Dim intd As Integer
Private Sub Form_Load()
inty = Year(Date)
intm = Month(Date)
intd = Day(Date)
End Sub
Private Sub mnabout_Click()
frmAbout.Show
End Sub
Private Sub mnBuy_Click()
frmAddgoods.Show
End Sub
Private Sub mnBuyMonth_Click()
frmBuyall.Text2.Enabled = False
frmBuyall.SSTab1.Tab = 1
frmBuyall.SSTab1.TabEnabled(0) = False
frmBuyall.SSTab1.TabEnabled(1) = True
frmBuyall.SSTab1.TabEnabled(2) = False
frmBuyall.SSTab1.TabEnabled(3) = False
frmBuyall.Show
strbuy = "select * from buy where 進貨年=" & inty & " and 進貨月=" & intm & " "
rs_buy.Open strbuy, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc2.RecordSource = strbuy
frmBuyall.Adodc2.Refresh
frmBuyall.DataGrid2.ReBind
If rs_buy.EOF = True Then
frmBuyall.Adodc6.RecordSource = strbuy
frmBuyall.Adodc6.Refresh
frmBuyall.DataGrid6.ReBind
MsgBox "您本月沒有進貨記錄!", vbOKOnly + vbInformation, "注意"
frmBuyall.Command9.Enabled = False
frmBuyall.Command10.Enabled = False
frmBuyall.Command11.Enabled = False
frmBuyall.Command12.Enabled = False
frmBuyall.Command13.Enabled = False
frmBuyall.Command14.Enabled = False
frmBuyall.Command15.Enabled = False
frmBuyall.Command16.Enabled = False
rs_buy.Close
Exit Sub
End If
rs_buy.Close
strfctotal = "select 生產(chǎn)廠商,sum(總金額) as 各廠商進貨總金額 from buy where 進貨年=" & inty & " and 進貨月=" & intm & " group by 生產(chǎn)廠商"
rs_fctotal.Open strfctotal, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc6.RecordSource = strfctotal
frmBuyall.Adodc6.Refresh
frmBuyall.DataGrid6.ReBind
rs_fctotal.Close
strtotal = "select sum(總金額) as 進貨總金額 from buy where 進貨年=" & inty & " and 進貨月=" & intm & " "
rs_total.Open strtotal, cnn, adOpenKeysetm, adLockPessimistic
frmBuyall.Text2.Text = rs_total.Fields("進貨總金額")
rs_total.Close
End Sub
Private Sub mnBuyQuarterly_Click()
frmBuyall.Text3.Enabled = False
frmBuyall.SSTab1.Tab = 2
frmBuyall.SSTab1.TabEnabled(0) = False
frmBuyall.SSTab1.TabEnabled(1) = False
frmBuyall.SSTab1.TabEnabled(2) = True
frmBuyall.SSTab1.TabEnabled(3) = False
frmBuyall.Show
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
strbuy = "select * from buy where 進貨年=" & inty & " and 進貨月 between " & (intm - 2) & " and " & intm & " "
rs_buy.Open strbuy, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc2.RecordSource = strbuy
frmBuyall.Adodc2.Refresh
frmBuyall.DataGrid2.ReBind
If rs_buy.EOF = True Then
frmBuyall.Adodc6.RecordSource = strbuy
frmBuyall.Adodc6.Refresh
frmBuyall.DataGrid6.ReBind
MsgBox "您本季度沒有進貨記錄!", vbOKOnly + vbInformation, "注意"
frmBuyall.Command17.Enabled = False
frmBuyall.Command18.Enabled = False
frmBuyall.Command19.Enabled = False
frmBuyall.Command20.Enabled = False
frmBuyall.Command21.Enabled = False
frmBuyall.Command22.Enabled = False
frmBuyall.Command23.Enabled = False
frmBuyall.Command24.Enabled = False
rs_buy.Close
Exit Sub
End If
rs_buy.Close
strfctotal = "select 生產(chǎn)廠商,sum(總金額) as 各廠商進貨總金額 from buy where 進貨年=" & inty & " and 進貨月 between " & (intm - 2) & " and " & intm & " group by 生產(chǎn)廠商"
rs_fctotal.Open strfctotal, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc6.RecordSource = strfctotal
frmBuyall.Adodc6.Refresh
frmBuyall.DataGrid6.ReBind
rs_fctotal.Close
strtotal = "select sum(總金額) as 進貨總金額 from buy where 進貨年=" & inty & " and 進貨月 between " & (intm - 2) & " and " & intm & " "
rs_total.Open strtotal, cnn, adOpenKeysetm, adLockPessimistic
frmBuyall.Text3.Text = rs_total.Fields("進貨總金額")
rs_total.Close
intm = Month(Date)
End Sub
Private Sub mnBuyTable_Click()
frmBuyTable.Show
End Sub
Private Sub mnBuyToday_Click()
frmBuyall.Text1.Enabled = False
frmBuyall.SSTab1.Tab = 0
frmBuyall.SSTab1.TabEnabled(0) = True
frmBuyall.SSTab1.TabEnabled(1) = False
frmBuyall.SSTab1.TabEnabled(2) = False
frmBuyall.SSTab1.TabEnabled(3) = False
frmBuyall.Show
strbuy = "select * from buy where 進貨年=" & inty & " and 進貨月=" & intm & " and 進貨日=" & intd & " "
rs_buy.Open strbuy, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc1.RecordSource = strbuy
frmBuyall.Adodc1.Refresh
frmBuyall.DataGrid1.ReBind
If rs_buy.EOF = True Then
frmBuyall.Adodc5.RecordSource = strbuy
frmBuyall.Adodc5.Refresh
frmBuyall.DataGrid5.ReBind
MsgBox "您今日沒有進貨記錄!", vbOKOnly + vbInformation, "注意"
frmBuyall.Command1.Enabled = False
frmBuyall.Command2.Enabled = False
frmBuyall.Command3.Enabled = False
frmBuyall.Command4.Enabled = False
frmBuyall.Command5.Enabled = False
frmBuyall.Command6.Enabled = False
frmBuyall.Command7.Enabled = False
frmBuyall.Command8.Enabled = False
rs_buy.Close
Exit Sub
End If
rs_buy.Close
strfctotal = "select 生產(chǎn)廠商,sum(總金額) as 各廠商進貨總金額 from buy where 進貨年=" & inty & " and 進貨月=" & intm & "and 進貨日=" & intd & " group by 生產(chǎn)廠商"
rs_fctotal.Open strfctotal, cnn, adOpenKeyset, adLockPessimistic
frmBuyall.Adodc5.RecordSource = strfctotal
frmBuyall.Adodc5.Refresh
frmBuyall.DataGrid5.ReBind
rs_fctotal.Close
strtotal = "select sum(總金額) as 進貨總金額 from buy where 進貨年=" & inty & " and 進貨月=" & intm & "and 進貨日=" & intd & ""
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -