?? frmmain.frm
字號(hào):
VERSION 5.00
Begin VB.MDIForm frmMain
BackColor = &H8000000C&
Caption = "四川百事可樂(lè)公司倉(cāng)庫(kù)庫(kù)存管理系統(tǒng)"
ClientHeight = 4080
ClientLeft = 60
ClientTop = 630
ClientWidth = 7605
Icon = "frmMain.frx":0000
LinkTopic = "MDIForm1"
StartUpPosition = 2 '屏幕中心
WindowState = 2 'Maximized
Begin VB.Menu mnuSet_jczl
Caption = "基礎(chǔ)資料設(shè)置"
Begin VB.Menu mnuSet_department
Caption = "部門(mén)設(shè)置"
End
Begin VB.Menu mnuSet_employee
Caption = "員工設(shè)置"
End
Begin VB.Menu mnuSet_protype
Caption = "物品類(lèi)別設(shè)置"
End
Begin VB.Menu mnuSet_product
Caption = "物品設(shè)置"
End
Begin VB.Menu mnuSet_supplier
Caption = "供應(yīng)商設(shè)置"
End
End
Begin VB.Menu mnuAct_dj
Caption = "單據(jù)處理"
Begin VB.Menu mnuAct_orders
Caption = "入庫(kù)單處理"
Begin VB.Menu mnuAct_ps
Caption = "采購(gòu)入庫(kù)單"
Begin VB.Menu mnuEdit_ps
Caption = "采購(gòu)入庫(kù)單編輯"
End
Begin VB.Menu mnuRec_ps
Caption = "采購(gòu)入庫(kù)單審核"
End
End
Begin VB.Menu mnuAct_other
Caption = "其它入庫(kù)單"
Begin VB.Menu mnuEdit_other
Caption = "其它入庫(kù)單編輯"
End
Begin VB.Menu mnuRec_other
Caption = "其它入庫(kù)單審核"
End
End
End
Begin VB.Menu mnuAct_sales
Caption = "出庫(kù)單處理"
Begin VB.Menu mnuEdit_sales
Caption = "出庫(kù)單編輯"
End
Begin VB.Menu mnuRec_sales
Caption = "出庫(kù)單審核"
End
End
Begin VB.Menu mnuAct_mat
Caption = "庫(kù)存調(diào)整單處理"
Begin VB.Menu mnuEdit_mat
Caption = "庫(kù)存調(diào)整單編輯"
End
Begin VB.Menu mnuRec_mat
Caption = "庫(kù)存調(diào)整單審核"
End
End
End
Begin VB.Menu mnuSql
Caption = "統(tǒng)計(jì)查詢(xún)"
Begin VB.Menu mnuSql_dj
Caption = "已過(guò)帳單據(jù)查詢(xún)"
Begin VB.Menu mnuSql_djps
Caption = "采購(gòu)入庫(kù)單"
End
Begin VB.Menu mnuSql_djother
Caption = "其它入庫(kù)單"
End
Begin VB.Menu mnuSql_djsales
Caption = "出庫(kù)單"
End
Begin VB.Menu mnuSql_djmat
Caption = "庫(kù)存調(diào)整單"
End
End
End
Begin VB.Menu mnuSystem
Caption = "系統(tǒng)維護(hù)"
Begin VB.Menu mnuSys_begqty
Caption = "期初庫(kù)存錄入"
End
Begin VB.Menu mnuSys_start
Caption = "系統(tǒng)啟用"
End
Begin VB.Menu mnuSys_user
Caption = "操作員設(shè)置"
End
Begin VB.Menu mnuSys_delete
Caption = "資料刪除"
End
Begin VB.Menu mnuSys_trans
Caption = "月終結(jié)轉(zhuǎn)"
End
End
Begin VB.Menu mnuReport
Caption = "報(bào)表輸出"
Begin VB.Menu mnuReport_Mat
Caption = "倉(cāng)庫(kù)庫(kù)存報(bào)表"
End
Begin VB.Menu mnuReport_Use
Caption = "領(lǐng)用報(bào)表"
Begin VB.Menu mnuReport_DetailUse
Caption = "部門(mén)領(lǐng)用明細(xì)表"
End
Begin VB.Menu mnuReport_TotalUse
Caption = "部門(mén)領(lǐng)用匯總表"
End
Begin VB.Menu mnuReport_TotalYearUse
Caption = "部門(mén)領(lǐng)用年度匯總表"
End
End
End
Begin VB.Menu mnuExit
Caption = "退出系統(tǒng)"
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private rsSys As ADODB.Recordset
Private cmSys As ADODB.Command
Public Function connstring() As String
connstring = "Provider=Microsoft.Jet.OLEDB.4.0;Persist " & _
"Security Info=False;Data Source=" & App.Path & "/db_jxc.mdb"
' Conjxc.ConnectionString = strConnect
'"Provider=Microsoft.Jet.OLEDB.4.0;Persist " & _
' "Security Info=False;Data Source=" & App.Path & "\data\db_jxc.mdb"
' Conjxc.ConnectionString = strConnect
End Function
Private Sub MDIForm_Load()
Dim strSQL As String
'Dim rsSys As ADODB.Recordset
Dim Conjxc As ADODB.Connection
Set Conjxc = New ADODB.Connection
Conjxc.ConnectionString = connstring
Dim rsSys As ADODB.Recordset
Conjxc.Open 'adOpenDynamic, adLockOptimistic
strSQL = "select offline from r_parameter"
Set rsSys = New ADODB.Recordset
rsSys.Open strSQL, Conjxc, adOpenKeyset, adLockOptimistic
'rsSys.MoveFirst
If rsSys!offline Then
Me.mnuAct_dj.Enabled = False
Me.mnuSql.Enabled = False
Me.mnuReport.Enabled = False
Me.mnuSys_trans.Enabled = False
Me.mnuSys_start.Enabled = True
Me.mnuSys_begqty.Enabled = True
Else
Me.mnuAct_dj.Enabled = True
Me.mnuSql.Enabled = True
Me.mnuReport.Enabled = True
Me.mnuSys_trans.Enabled = True
Me.mnuSys_start.Enabled = False
Me.mnuSys_begqty.Enabled = False
End If
rsSys.Close
'Set cmSys = New ADODB.Command
'cmSys.ActiveConnection = DEjxc.Conjxc
'cmSys.CommandType = adCmdText
End Sub
'Private Sub MDIForm_Load()
' Dim strSQL As String
' Dim Conjxc As ADODB.Connection
' Set Conjxc = New ADODB.Connection
' Conjxc.ConnectionString = connstring
' strSQL = "select offline from r_parameter"
' Set rsSys = New ADODB.Recordset
' rsSys.Open Conjxc, adOpenDynamic, adLockOptimistic
' rsSys.MoveFirst
' If rsSys!offline Then
' Me.mnuAct_dj.Enabled = False
' Me.mnuSql.Enabled = False
' Me.mnuReport.Enabled = False
' Me.mnuSys_trans.Enabled = False
' Me.mnuSys_start.Enabled = True
' Me.mnuSys_begqty.Enabled = True
' Else
' Me.mnuAct_dj.Enabled = True
' Me.mnuSql.Enabled = True
' Me.mnuReport.Enabled = True
' Me.mnuSys_trans.Enabled = True
' Me.mnuSys_start.Enabled = False
' Me.mnuSys_begqty.Enabled = False
' End If
' rsSys.Close
' Set cmSys = New ADODB.Command
' cmSys.ActiveConnection = DEjxc.Conjxc
' cmSys.CommandType = adCmdText
'End Sub
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Call mnuExit_Click
If intNumWindows > 0 Then
Cancel = True
End If
Set rsSys = Nothing
Set cmSys = Nothing
End Sub
Private Sub mnuEdit_other_Click()
FrmOtherEdit.Show
End Sub
Private Sub mnuEdit_ps_Click()
FrmPsEdit.Show
End Sub
Private Sub mnuEdit_sales_Click()
FrmSaleEdit.Show
End Sub
Private Sub mnuExit_Click()
If intNumWindows = 0 Then
Unload Me
Else
MsgBox "請(qǐng)關(guān)閉所有子程序后再關(guān)閉該主程序!", vbCritical, "提示"
End If
End Sub
Private Sub mnuRec_other_Click()
FrmOtherChk.Show
End Sub
Private Sub mnuRec_ps_Click()
FrmPsChk.Show
End Sub
Private Sub mnuRec_sales_Click()
FrmSaleChk.Show
End Sub
Private Sub mnuReport_DetailUse_Click()
FrmRptDetUse.Show
End Sub
Private Sub mnuReport_Mat_Click()
FrmRptMat.Show
End Sub
Private Sub mnuReport_TotalUse_Click()
FrmRptTotUse.Show
End Sub
Private Sub mnuReport_TotalYearUse_Click()
FrmRptYearUse.Show
End Sub
Private Sub mnuSet_department_Click()
FrmSetDep.Show
End Sub
Private Sub mnuSet_employee_Click()
FrmSetEmp.Show
End Sub
Private Sub mnuSet_product_Click()
FrmSetPro.Show
End Sub
Private Sub mnuSet_protype_Click()
FrmSetPrTy.Show
End Sub
Private Sub mnuSet_supplier_Click()
FrmSetSup.Show
End Sub
Private Sub mnuSql_djother_Click()
FrmOtherSql.Show
End Sub
Private Sub mnuSql_djps_Click()
FrmPsSql.Show
End Sub
Private Sub mnuSql_djsales_Click()
FrmSaleSql.Show
End Sub
Private Sub mnuSys_begqty_Click()
FrmSetMattmp.Show
End Sub
Private Sub mnuSys_delete_Click()
Dim intDel As Integer
Dim strSQL As String
intDel = MsgBox("確認(rèn)要?jiǎng)h除所有資料碼?", vbInformation + vbYesNo, "刪除確認(rèn)")
If intDel = vbYes Then
strSQL = "delete from department"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from employee"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from mat_detail"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from mat_head"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "select p_id,qty,price into mat_tmp from mat_head"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "drop table mat_head"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "select p_id,qty,price into mat_head from mat_tmp"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "update mat_head set qty=0,price=0"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "drop table mat_tmp"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from product"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from product_type"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from supplier"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from order_detail_a"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from order_detail_b"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from ps_head_a"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from ps_head_b"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from other_head_a"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from other_head_b"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from sale_detail_a"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from sale_detail_b"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from sale_head_a"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "delete from sale_head_b"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "update r_parameter set offline=true,psnumber=0"
cmSys.CommandText = strSQL
cmSys.Execute
MsgBox "資料刪除完畢!", vbInformation, "資料刪除"
End If
Me.mnuAct_dj.Enabled = False
Me.mnuSql.Enabled = False
Me.mnuReport.Enabled = False
Me.mnuSys_trans.Enabled = False
Me.mnuSys_start.Enabled = True
Me.mnuSys_begqty.Enabled = True
End Sub
Private Sub mnuSys_start_Click()
Dim strBeg As String
Dim strYear, strMonth As String
Dim strSQL As String
strBeg = InputBox("請(qǐng)輸入系統(tǒng)啟用時(shí)間", "系統(tǒng)啟用", CStr(Date))
If IsDate(strBeg) Then
strYear = Right(CStr(Year(CDate(strBeg))), 2)
strMonth = Format(CStr(Month(CDate(strBeg))), "0#")
strSQL = "alter table mat_head add column qty" & strYear & strMonth _
& " single"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "alter table mat_head add column price" & strYear & strMonth _
& " currency"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "update mat_head set qty" & strYear & strMonth & "=qty," & _
" price" & strYear & strMonth & "=price"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "update r_parameter set pass_date=cdate('" & strBeg & _
"'),offline=false,monthdate=cdate('" & strBeg & "')"
cmSys.CommandText = strSQL
cmSys.Execute
Me.mnuAct_dj.Enabled = True
Me.mnuSql.Enabled = True
Me.mnuReport.Enabled = True
Me.mnuSys_trans.Enabled = True
Me.mnuSys_start.Enabled = False
MsgBox "系統(tǒng)已正式啟用!", vbInformation, "系統(tǒng)啟用"
Else
MsgBox "日期格式錯(cuò)誤!", vbCritical, "啟用錯(cuò)誤"
Exit Sub
End If
End Sub
Private Sub mnuSys_trans_Click()
Dim strBeg As String
Dim strYear, strMonth As String
Dim strSQL As String
strBeg = InputBox("請(qǐng)輸入月終結(jié)轉(zhuǎn)時(shí)間", "月終結(jié)轉(zhuǎn)", CStr(Date))
If IsDate(strBeg) Then
strSQL = "select monthdate from r_parameter"
Set rsSys = New ADODB.Recordset
rsSys.Open strSQL, DEjxc.Conjxc, adOpenDynamic, adLockOptimistic
rsSys.MoveFirst
If Format(CDate(strBeg), "yyyy-mm") > Format(rsSys!monthdate, "yyyy-mm") Then
strYear = Right(CStr(Year(CDate(strBeg))), 2)
strMonth = Format(CStr(Month(CDate(strBeg))), "0#")
strSQL = "alter table mat_head add column qty" & strYear & strMonth _
& " single"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "alter table mat_head add column price" & strYear & strMonth _
& " currency"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "update mat_head set qty" & strYear & strMonth & "=qty," & _
" price" & strYear & strMonth & "=price"
cmSys.CommandText = strSQL
cmSys.Execute
strSQL = "update r_parameter set monthdate=cdate('" & strBeg & _
"')"
cmSys.CommandText = strSQL
cmSys.Execute
MsgBox "月份結(jié)轉(zhuǎn)完畢!", vbInformation, "月終結(jié)轉(zhuǎn)"
Else
MsgBox "該月份已經(jīng)月終結(jié)轉(zhuǎn)!", vbCritical, "月終結(jié)轉(zhuǎn)錯(cuò)誤"
End If
Else
MsgBox "日期格式錯(cuò)誤!", vbCritical, "啟用錯(cuò)誤"
Exit Sub
End If
End Sub
Private Sub mnuSys_user_Click()
FrmSetUser.Show
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -