倉庫管理系統(tǒng)(VB+Access+源代碼)_第1頁
倉庫管理系統(tǒng)(VB+Access+源代碼)_第2頁
倉庫管理系統(tǒng)(VB+Access+源代碼)_第3頁
倉庫管理系統(tǒng)(VB+Access+源代碼)_第4頁
倉庫管理系統(tǒng)(VB+Access+源代碼)_第5頁
免費預(yù)覽已結(jié)束,剩余20頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、精心整理倉庫管理系統(tǒng)項目的建立這是本人利用閑暇之余在 VB6.0上制作的一個簡陋的類庫管系統(tǒng),現(xiàn)圖文結(jié)合的方式一步一步展 現(xiàn)制作過程。由于本人是個初學(xué)者,里面存在很多不足之處望得到高手們的指導(dǎo)。 此文可作供初學(xué) 者們學(xué)習(xí)交流。作者聯(lián)系方式:E-mail 最終運行效果打開軟件出現(xiàn)如下登錄界面輸入系統(tǒng)預(yù)設(shè)用戶名及密碼(1 1 )單擊“登錄”或單擊“新用戶”添加新用戶進入如下主界面:建立工程1、 創(chuàng)建標準EXE2、 按“打開”3、 添加MDI窗體打開4、 編輯菜單在空白處右擊一一點擊“菜單編輯器”在“標題”里輸入“系統(tǒng)”,在“名稱”里輸入“ SyS'(注意此處不能為漢字)點擊“下一個”再點擊

2、&”“確定”退到MDI界面點擊“系統(tǒng)”一一“退出”如下,然后編寫代碼。代碼如下:Private Sub Exit_Click() EndEnd Sub數(shù)據(jù)庫的建立VB6.0中可以創(chuàng)建Access數(shù)據(jù)庫。如下建立一個“用戶表”的數(shù)據(jù)庫,用來存放用戶信息及一些出入庫管理信息。如下圖單擊“外接程序”再單擊“可視化數(shù)據(jù)管理器”出現(xiàn)如圖點擊“文件”“新建”" Microsoft Access”“Version 2.0 MDB'輸入數(shù)據(jù)庫名,“保存”出現(xiàn)如下圖在數(shù)據(jù)窗口中右擊一一“新建表”,最終如下往數(shù)據(jù)表里添加數(shù)據(jù)在這里就不羅嗦了,請查閱相關(guān)書籍。精心整理登錄界面窗口的建立最終

3、界面如下:1、Adodcl的添加過程為:單擊“工程”一一“部件”出現(xiàn)下圖所示,選擇“控件”下的“MicrosoftADO Data Control 6.0 (OLEDB ”單擊“確定”在工具欄中會出現(xiàn)“曠”圖標,單擊它并拖動到相應(yīng)位置即可。其它元件不在一一說明。2、本窗體代碼如下:Private Sub Command1_Click()'"登錄”、“確定”按鈕If Command1.Caption ="確定"And Command2.Caption =" 取消"Then'如果為“確定”則添加新用戶If Text1.Text =

4、"" Then'提示用戶輸入用戶名MsgBox ”請輸入用戶名!"一" 登錄信息提示:"Exit SubElse'Dim usename As String'檢測用戶名是否已經(jīng)存在Dim strS As Stringusename = Trim(Text1.Text)strS = "select * from用戶登錄信息表 where 用戶名='"& usename & ""'Adodc1.CommandType = adCmdTextAdodc1.

5、RecordSource = strSAdodc1.RefreshMsgBox " 您輸入的用戶已存在!",”登錄提示信息:"Text1.Text =""Text2.Text =""Text3.Text =""Text1.SetFocusExit SubEnd IfEnd IfIf Text2.Text = "" Then'提示用戶密碼不能為空MsgBox " 密碼不能為空!"" 登錄提示信息:"Text2.SetFocusExit Su

6、bEnd IfIf Text3.Text = "" ThenMsgBox "請再次輸入密碼!","登錄提示信息:"Text3.SetFocusExit SubEnd IfIf Text2.Text <> Text3.Text ThenMsgBox "兩次輸入的密碼不一致,請確認!","登錄提示信息:"Text2.Text =""Text3.Text =""Text2.SetFocus精心整理精心整理Exit Sub精心整理ElseMsgBox

7、(“添加新用戶成功,現(xiàn)在您可以登陸系統(tǒng)了!Label3.Visible = FalseText3.Visible = FalseCommandl.Caption ="登錄"Command2.Caption ="退出"End IfElse'Dim strSno As StringDim strSelect As StringstrSno = Trim(Text1.Text)'strSelect = "select密碼from用戶登錄信息表Adodc1.CommandType = adCmdTextAdodc1.RecordSour

8、ce = strSelect")“登錄”按鈕,用戶登錄檢測用戶名是否存在where 用戶名='"& strSno & "川Adodc1.RefreshMsgBox”用戶名不存在,請重新輸入!"一"登錄提示信息:Text1.Text =""Text2.Text =""Textl.SetFocusExit SubEnd IfForml.Hide'Unload MeForm2.Show'MsgBox "登陸成功!"一" 登錄提示信息:&quo

9、t;ElseMsgBox "密碼不正確,請重新輸入!"一"登錄提示信息:Text2.Text =""Text2.SetFocusEnd If?人。/“二一、八 End IfEnd Sub .:“退出”或“取消”按鈕Private Sub Command2_Click()'If Command2.Caption ="取消"ThenLabel3.Visible = FalseText3.Visible = FalseCommandl.Caption ="登錄"Command2.Caption =&qu

10、ot;退出"Textl.Text =""Text2.Text =""Textl.SetFocusElseEnd 'Unload MeEnd IfEnd Sub精心整理Private Sub Command3_Click()'“新用戶”按鈕Label3.Visible = TrueText3.Visible = TrueTextl.Text =""Text2.Text =""Text3.Text =""Commandl.Caption =" 確定"Co

11、mmand2.Caption =" 取消"Textl.SetFocusEnd SubPrivate Sub Command3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label6.Visible = TrueEnd SubPrivate Sub Command3_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label6.Visible = FalseEnd SubPrivate

12、 Sub Form_Load()Label3.Visible = FalseText3.Visible = FalseEnd Sub時間timel控件的time事件代碼,用來顯示向左移動的歡迎字幕當(dāng)標簽右邊位置大于 0時,標簽向左移否則標簽從頭開始Private Sub Timer1_Timer()If Label4.Left + Label4.Width > 0 ThenLabel4.Move Label4.Left - 80ElseLabel4.Left = Forml.ScaleWidthEnd IfIf Label5.Left + Label5.Width > 0 Then

13、Label5.Move Label5.Left - 80ElseLabel5.Left = Forml.ScaleWidthEnd IfEnd Sub .:主界面窗體如下:代碼:Private Sub AddNew_Click()Framel.Visible = TrueFrame2.Visible = FalseEnd SubPrivate Sub CHKPMCHX_Click()Frame2.Caption =" 出庫信息Dim pm As String精心整理Dim n As Stringpm = InputBox(" 產(chǎn)品名","請輸入"

14、;,0)n = "select * from 出庫表 where 品名='"& pm & "切Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub CHKXHCHX_Click()Frame2.Caption ="出庫信息"Dim XH As StringDim n As StringXH = InputBox(" 產(chǎn)品型號"," 請輸入"

15、;,0)n = "select * from 出庫表 where 型號='"& XH & "川Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd SubPrivate Sub CKCZ_Click()'Form2.HideForm6.ShowEnd SubPrivate Sub CKJSHR_Click()Frame2.Caption ="出庫信息"Dim JSHR As StringDim n As StringJSHR

16、= InputBox(" 經(jīng)手人","請輸入",0)n = "select * from 出庫表 where 經(jīng)手人='"& JSHR & "”'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGridlEnd Sub.:Private Sub CKSHJ_Click()Frame2.Caption ="出庫信息"Dim CHKRQ As StringDim n As S

17、tringCHKRQ = InputBox("出庫日期,格式為:月/日/年 如:12/1/2011","請輸入",0)n = "select * from 出庫表 where 出庫日期='"& CHKRQ & "川Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub CKZCX_Click()Frame2.Caption ="出庫信息"精

18、心整理精心整理Dim ZB As StringZB = "select * from 出庫表"Adodc2.CommandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid1End SubPrivate Sub Command1_Click()If Text1.Text = ""Then'提示用戶輸入用戶名MsgBox "請輸入用戶名!"一"登錄信息提示:"Exit SubElse'Dim usename As St

19、ring'檢測用戶名是否已經(jīng)存在Dim strS As Stringusename = Trim(Text1.Text)strS = "select * from用戶登錄信息表 where 用戶名="'& usename & ""'Adodc1.CommandType = adCmdTextAdodc1.RecordSource = strSAdodc1.RefreshMsgBox "您輸入的用戶已存在 匚,”登錄提示信息:"Text1.Text =""Text2.Text

20、=""Text3.Text =""Text1.SetFocusExit Sub End IfEnd IfIf Text2.Text = "" Then'提示用戶密碼不能為空MsgBox " 密碼不能為空!","登錄提示信息:"Text2.SetFocusExit Sub_ 7 :!J:|End IfIf Text3.Text = "" Then,:MsgBox "請再次輸入密碼!","登錄提示信息:"Text3.SetFocus

21、 Exit SubEnd IfIf Text2.Text <> Text3.Text ThenMsgBox "兩次輸入的密碼不一致,請確認!","登錄提示信息:"Text2.Text =""Text3.Text =""Text2.SetFocusExit SubElse e精心整理X = MsgBox("成功添加新用戶,是否要重新登錄!”, vbYesNo + vbQuestion + vbDefaultButtonl,“提示信息!。If X = vbYes ThenUnload MeForm

22、3.ShowEnd If'MsgBox ("成功添加新用戶!")'Label3.Visible = False'Text3.Visible = False'Command1.Caption ="登錄"'Command2.Caption ="退出"End IfFrame1.Visible = FalseFrame2.Visible = TrueText1.Text =""Text2.Text ="小Text3.Text =""'Form3.

23、ShowEnd SubPrivate Sub Command2_Click()Frame1.Visible = FalseFrame2.Visible = TrueEnd SubPrivate Sub CXDL_Click()Form3.Show'Unload MeEnd SubPrivate Sub Exit_Click()EndUnload Form1Unload Form2Unload Form3Unload Form4Unload Form5 .:Unload Form6Unload Form7Unload Form8End SubPrivate Sub Form_Load()

24、Unload Form1Frame1.Visible = FalseCall InitGrid0Me.Height = MDIForm1.Height - 1060Me.Width = MDIForm1.Width - 560Me.Top = MDIForm1.TopMe.Left = MDIForm1.LeftEnd Sub精心整理Private Sub GHCZ_Click()'Form2.HideForm8.ShowEnd SubPrivate Sub GHPMCX_Click()Frame2.Caption ="歸還信息"Dim pm As StringDi

25、m n As Stringpm = InputBox(" 產(chǎn)品名","請輸入",0)n = "select * from 歸還表 where 品名='"& pm & "“'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHRCX_Click()Frame2.Caption ="歸還信息"Dim JCR As StringD

26、im n As StringJCR = InputBox("歸還人","請輸入",0)n = "select * from 歸還表 where 歸還人='"& JCR & "”'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHSJCX_Click()Frame2.Caption ="歸還信息"Dim JCRQ As St

27、ringDim n As StringJCRQ = InputBox(" 歸還日期,格式為:月/日/年如:12/1/2011","請輸入",0)_ Y 1 .:;*:)” 一:" JIn = "select * from 歸還表 where 歸還日期='"& JCRQ & "川Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHXHCX_Cl

28、ick()Frame2.Caption ="歸還信息"Dim XH As StringDim n As StringXH = InputBox(" 產(chǎn)品型號"," 請輸入",0)n = "select * from 歸還表 where 型號='"& XH & "“'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.Refresh精心整理精心整理Call InitGrid2End SubPrivate Su

29、b GHZCX_Click()Frame2.Caption =" 歸還信息"Dim ZB As StringZB = "select * from 歸還表"Adodc2.CommandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCCZ_Click()'Form2.HideForm7.ShowEnd SubPrivate Sub JCHPMCHX_Click()Frame2.Caption =" 借出信息&q

30、uot;Dim pm As StringDim n As Stringpm = InputBox(" 產(chǎn)品名","請輸入",0)n = "select * from 借出表 where 品名='"& pm & "切Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCHXHCHX_Click()Frame2.Caption =" 借出信息&qu

31、ot;Dim XH As StringDim n As StringXH = InputBox("產(chǎn)品型號","請輸入",0) 八 In = "select * from 借出表 where 型號='"& XH & "川Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCRCX_Click()Frame2.Caption =" 借出信息&qu

32、ot;Dim JCR As StringDim n As StringJCR = InputBox(" 借出人","請輸入",0)n = "select * from 借出表 where 借出人='"& JCR & ""'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd SubPrivate Sub JCSHJCX_Click()Frame2.Caption ="借出信息"

33、Dim JCRQ As StringDim n As StringJCRQ = InputBox(" 借出日期,格式為:月/日/年如:12/1/2011","請輸入",0)n = "select * from 借出表 where 借出日期='"& JCRQ & ""'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCZCX_Clic

34、k()Frame2.Caption ="借出信息"Dim ZB As StringZB = "select * from 借出表"Adodc2.CommandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.Refresh. 、Call InitGrid2End SubPrivate Sub JSHRCHX_Click()Frame2.Caption ="歸還信息"Dim JSHR As StringDim n As StringJSHR = InputBox(" 經(jīng)手人"

35、;,"請輸入",0)n = "select * from 歸還表 where 經(jīng)手人='"& JSHR & "”'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.Refresh_ Y(,.八Call InitGrid2End Sub.:Private Sub JSHRCX_Click()Frame2.Caption ="借出信息"Dim JSHR As StringDim n As StringJSHR = InputBo

36、x(" 經(jīng)手人","請輸入",0)n = "select * from 借出表 where 經(jīng)手人='"& JSHR & "”'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub PMCX_Click()Frame2.Caption ="庫存信息精心整理精心整理Dim pm As StringDim n As Stringpm = Inp

37、utBox(" 產(chǎn)品名","請輸入",0)n = "select * from 庫存表 where 品名='"& pm & "切Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid0End SubPrivate Sub RKCZ_Click()'Form2.HideForm5.ShowEnd SubPrivate Sub RKJSHR_Click()Frame2.Caption =&qu

38、ot;入庫信息"Dim JSHR As StringDim n As StringJSHR = InputBox(" 經(jīng)手人","請輸入",0)n = "select * from 入庫表 where 經(jīng)手人='"& JSHR & ""'Adodc2.CommandType = adCmdText尸、;、Adodc2.RecordSource = nAdodc2.RefreshCall InitGridlEnd SubPrivate Sub RKPMCHX_Click()F

39、rame2.Caption ="入庫信息"Dim pm As StringDim n As Stringpm = InputBox(" 產(chǎn)品名","請輸入",0)If Len(pm) > 0 Thenn = "select * from 入庫表 where 品名='"& pm & "mY. iyJ、八、Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGridlE

40、nd SubPrivate Sub RKSHJ_Click()Frame2.Caption ="入庫信息"Dim RKRQ As StringDim n As StringRKRQ = InputBox(" 入庫日期,格式為:月/日/年如:12/1/2011","請輸入",0)n = "select * from 入庫表 where 入庫日期='"& RKRQ & "“'Adodc2.CommandType = adCmdTextAdodc2.RecordSource =

41、nAdodc2.Refresh精心整理精心整理Call InitGrid2End SubPrivate Sub RKXHCHX_Click()Frame2.Caption ="入庫信息"Dim XH As StringDim n As StringXH = InputBox(" 產(chǎn)品型號"," 請輸入",0)If Len(XH) > 0 Thenn = "select * from 入庫表 where 型號='"& XH & "”'Adodc2.CommandType

42、 = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGrid1End SubPrivate Sub RKZCX_Click()Frame2.Caption ="入庫信息"Dim ZB As StringZB = "select * from 入庫表"Adodc2.CommandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGridlEnd SubPrivate Sub Timer1_Timer()If

43、 Label4.Left + Label4.Width > 0 Then'當(dāng)標簽右邊位置大于 0時,標簽向左移Label4.Move Label4.Left - 80Else'否則標簽從頭開始Label4.Left = Form2.ScaleWidthEnd IfIf Label5.Left + Label5.Width > 0 ThenLabel5.Move Label5.Left - 80Else.:Label5.Left = Form2.ScaleWidthEnd IfIf Label6.Left + Label6.Width > 0 ThenLabel

44、6.Move Label6.Left - 80ElseLabel6.Left = Form2.ScaleWidthEnd IfIf Label7.Left + Label7.Width > 0 ThenLabel7.Move Label7.Left - 80ElseLabel7.Left = Form2.ScaleWidthEnd IfEnd Sub精心整理精心整理Private Sub XGMM_Click()'Form2.HideForm4.ShowEnd SubPrivate Sub XHCX_Click()Frame2.Caption =" 庫存信息"

45、Dim XH As StringDim n As StringXH = InputBox(" 產(chǎn)品型號","請輸入",0)If Len(XH) > 0 Then 'And Val(XH) <> 0n = "select * from 庫存表 where 型號='"& XH & ""'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGrid0En

46、d SubPrivate Sub ZB_Click()Frame2.Caption =" 庫存信息"Dim ZB As String'Dim N As String'PM = InputBox(" 產(chǎn)品名","請輸入",0)ZB = "select * from 庫存表"'where 品名='"& PM & ""'Adodc2.CommandType = adCmdTextAdodc2.RecordSource = ZBAdodc

47、2.RefreshCall InitGrid0End SubPrivate Sub InitGrid0()With DataGrid1.Columns(0).Width = 1600、y :1七d .Columns(1).Width = 2200.Columns(2).Width = 2200.Columns(3).Width = 1000.Columns(4).Width = 1000.Columns(5).Width = 4000End WithEnd SubPrivate Sub InitGrid1()With DataGrid1.Columns(0).Width = 800.Colum

48、ns(1).Width = 1600.Columns(2).Width = 1600.Columns(3).Width = 800.Columns(4).Width = 800.Columns(5).Width = 1000精心整理.Columns(6).Width = 800.Columns(7).Width = 4000End WithEnd SubPrivate Sub InitGrid2()With DataGrid1'.Columns(0).Caption ="學(xué)號"'.Columns(1).Caption ="課程名"'

49、;.Columns(2).Caption ="學(xué)分"'.Columns(3).Caption ="成績"'設(shè)置DtgCond的歹U寬.Columns(0).Width = 800.Columns(1).Width = 1600.Columns(2).Width = 1600.Columns(3).Width = 800.Columns(4).Width = 800.Columns(5).Width = 800.Columns(6).Width = 1000.Columns(7).Width = 800.Columns(8).Width =

50、 4000End WithEnd Sub用戶重新登錄界面代碼:Private Sub Command1_Click()Dim strSno As StringDim strSelect As String檢測用戶名是否存在strSno = Trim(Text1.Text)'strSelect = "select密碼 from 用戶登錄信息表 where 用戶名='"& strSno & "“'Adodc1.CommandType = adCmdTextAdodc1.RecordSource = strSelectAdodc1

51、.RefreshMsgBox "用戶名不存在,請重新輸入!"一"登錄提示信息:"Text1.Text =""Text2.Text =""Text1.SetFocusExit SubEnd IfUnload MeForm2.Show'MsgBox "登陸成功!","登錄提示信息:"ElseMsgBox " 密碼不正確,請重新輸入!“,”登錄提示信息:”精心整理精心整理Text2.Text =""Text2.SetFocusEnd IfEnd

52、 SubPrivate Sub Command2_Click()Unload MeForm2.ShowEnd Sub修改用戶密碼界面代碼:Private Sub Command1_Click()If Trim(Text1.Text) <> Form2.TextUserName ThenMsgBox"用戶名不正確,請確認!"一"信息提示!"Text1.Text =""Text1.SetFocusExit SubElseDim name As StringDim names As Stringname = Trim(Text1

53、.Text)names = "select * from用戶登錄信息表 where 用戶名='"& name & ""'Adodcl.CommandType = adCmdTextAdodcI.RecordSource = namesAdodcI.RefreshIf Text2.Text = "" ThenMsgBox " 請輸入舊密碼 匚," 信息提示!"Text2.SetFocusExit SubEnd IfMsgBox "舊密碼不正確,請確認 匚,"

54、;信息提示!"Text2.Text =""Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "請輸入新密碼匚,"信息提示!"Text3.SetFocusExit SubEnd IfIf Text4.Text = "" ThenMsgBox "請再次輸入新密碼!",”信息提示!"Text4.SetFocusExit Sub精心整理精心整理End IfIf Trim(Text3.Text) <>

55、; Trim(Text4.Text) ThenMsgBox "兩次輸入的新密碼不一致匚,”信息提示!Text3.Text =""Text4.Text =""Text3.SetFocusExit SubElseMsgBox ("密碼修改成功!")Unload Me'Form2.ShowEnd IfEnd IfEnd SubPrivate Sub Command2_Click()Unload Me'Form2.ShowEnd Sub入庫管理代碼:Private Sub Command1_Click()If Tex

56、t1.Text = "" And Text2.Text = "" Then提示信息MsgBox"“品名”和“型號”不能同時為空,必須輸入其中一項 !",Exit SubText1.SetFocusElseIf Text3.Text = "" And Text4.Text = "" ThenMsgBox " 請輸入產(chǎn)品“數(shù)量”或“單位"之一 匚,"提示信息Text3.SetFocusExit SubEnd IfIf Text5.Text = ""

57、ThenMsgBox " 請經(jīng)手人簽名!", vbCritical,"提示信息!"Text5.SetFocusExit SubEnd IfAdodc1.RefreshEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Text1.Text)精心整理n = Val(Text3.Text)pms = "select * from 庫存表 where 品名='"& pm & ""'Wi

58、th Form2End WithElseEnd IfEnd IfDim X As IntegerX = MsgBox(" 產(chǎn)品入庫登記成功,是否繼續(xù)添加產(chǎn)品!”, vbYesNo + vbQuestion + vbDefaultButtonl,“ 提示信息!”)If X = vbNo ThenUnload Me'Form2.ShowElseTextl.Text =""Text2.Text =""Text3.Text =""Text4.Text =""Text5.Text =""

59、Text6.Text =""Text7.Text =""Textl.SetFocusEnd IfDim ZB As StringZB = "select * from 入庫表"'where 品名='"& PM & "mEnd SubPrivate Sub Command2_Click()Textl.Text =""Text2.Text =""Text3.Text =""Text4.Text =""Text

60、5.Text =""_ " y、o, j ,個 iText6.Text =""Text7.Text ="".:Textl.SetFocusEnd SubPrivate Sub Command3_Click()Unload Me'Form2.ShowEnd Sub出庫管理代碼:Private Sub Command1_Click()If Combol.Text = "" And Combo2.Text = "" Then ' textl.Text = "&quo

61、t; And Text2.Text = "" Then精心整理MsgBox” “品名”和“型號”不能同時為空,必須輸入其中一項匚,”提示信息!”Exit SubElseIf Textl.Text = "" And Combo3.Text = "" Then ' Text4.Text = ""ThenMsgBox"請輸入產(chǎn)品“數(shù)量”或“單位"之一 匚,"提示信息!"Text2.SetFocusExit SubEnd IfIf Text2.Text = "&qu

62、ot;ThenMsgBox "請經(jīng)手人簽名!", vbCritical,"提示信息!"Text2.SetFocusExit SubEnd IfAdodc1.RefreshEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Combo1.Text)n = Val(Text1.Text). J-“pms = "select * from 庫存表 where 品名='"& pm & ""

63、9;End IfDim X As IntegerX = MsgBox(" 產(chǎn)品出庫登記成功,是否繼續(xù)添加產(chǎn)品匚vbYesNo + vbQuestion + vbDefaultButtonl," 提示信息!")If X = vbNo ThenUnload Me'Form2.ShowEnd IfCombol.Text =""Combo2.Text =""Combo3.Text =""Textl.Text ="".:Text2.Text =""Text3.Text

64、 =""Text4.Text =""Dim ZB As StringZB = "select * from 出庫表"'where 品名='"& PM & "mEnd SubPrivate Sub Command2_Click()Combol.Text =""Combo2.Text =""Combo3.Text =""Textl.Text =""Text2.Text =""Text3.T

65、ext =""精心整理精心整理Text4.Text =""End SubPrivate Sub Command3_Click()Unload Me'Form2.ShowEnd SubPrivate Sub Form_Load()Adodc2.RefreshLoopEnd Sub借由管理代碼:Private Sub Command1_Click()If Combo1.Text = "" And Combo2.Text = "" Then ' text1.Text = "" And Text2.Text = "" ThenMsgBox" “品名”和“型號”不能同時為空,必須輸入其中一項!",”提示信息!"Exit SubEls

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論