倉庫管理系統(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頁
已閱讀5頁,還剩29頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、倉庫管理系統(tǒng)項(xiàng)目的建立這是本人利用閑暇之余在VB6.0上制作的一個(gè)簡陋的類庫管系統(tǒng),現(xiàn)圖文結(jié)合的方式一步一步展現(xiàn)制作過程。由于本人是個(gè)初學(xué)者,里面存在很多不足之處望得到高手們的指導(dǎo)。此文可作供初學(xué)者們學(xué)習(xí)交流。作者聯(lián)系方式:E-mail QQ:1355044347最終運(yùn)行效果主界面:打開軟件出現(xiàn)如下登錄界面輸入系統(tǒng)預(yù)設(shè)用戶名及密碼(1)單擊“登錄”或單擊“新用戶”添加新用戶進(jìn)入如下iBT l.fjiAVTfi 1LJI-4nL建立工程1、創(chuàng)建標(biāo)準(zhǔn)EXE2、按“打開”n X.-H L - laciEXQLLlirac Ifi iMspg 叩胃財(cái)耍Xfli:車鴛如14 mi燃!華敏g w頗if Q

2、I * ii時(shí)白8苫弁國廟-liBifliMM.taaElE0EA.國粉Hl CTflfib耳F.IAJ%5I3、添加MDI窗體打開【旦工住虹J1L近D QSS93H2SSXIw)DK.t. .TL-Bp o-r 4.DHTMLPMEHD M.t. .x onm At.把步Au歪五w.*理,十典-隅加立件 34、編輯菜單在空白處右擊一一點(diǎn)擊“菜單編輯器”,工程I - JaniLIVQEBJP 普也C f J fc i. w iHfcw.1T zi4?!:4 Itt。KTifl:砌新|Zfll -如8(F uu nior心DUU4JCHJ5JU映代碼如下:Private Sub Exit_Cli

3、ck()EndEnd Sub在“標(biāo)題”里輸入“系統(tǒng)”點(diǎn)擊“下一個(gè)”再點(diǎn)擊,在“名稱”里輸入“Sy(注意此處不能為漢字)“確定”退到MDI界面點(diǎn)擊“系統(tǒng)”一一“退出”如下,然后編寫代碼。X數(shù)據(jù)庫的建立VB6.0中可以創(chuàng)建Access數(shù)據(jù)庫。如下建立一個(gè)“用戶表”的數(shù)據(jù)庫,用來存放用戶信 息及一些出入庫管理信息。如下圖單擊“外接程序”外接程序SnQ) TOO!)再單擊“可視化數(shù)據(jù)管理器”出現(xiàn)如圖K4B IDB虐)HDB ll 點(diǎn)擊文件”- 新建”- Microsoft Access-aVersion 2.0 MDB”輸入數(shù)據(jù)庫名,“保存”出現(xiàn)如下圖vffi:iBCTi *fcnsV皿國初9 S母在

4、數(shù)據(jù)窗口中右擊一一“新建表”,最終如下玄博e巖用程序四 窗布助(M)鳳圖恭胃僵馳曰1 R1TisDat a.(3口區(qū)司打TORKEQ).,_ 喘| MicrQft*| VnTMfln f 0VtrlLtb. 1.0.WH嘵(EJOUKfQ) ttm.導(dǎo)Aj導(dǎo)出0、xiraw).洪.往數(shù)據(jù)表里添加數(shù)據(jù)在這里就不羅嗦了,請查閱相關(guān)書籍。登錄界面窗口的建立最終界面如下:1、Adodcl的添加過程為:單擊“工程”一一“部件”出現(xiàn)下圖所示,選擇“控件”下的Microsoft ADO Data Control 6.0(OLEDB ”單擊“確定”在工具欄中會出現(xiàn)“邪”圖標(biāo),單擊它并拖動(dòng)到相應(yīng)位置即可。其它元

5、件不在- 說明。2、本窗體代碼如下:Private Sub Command1_Click()登錄”、“確定”按鈕If Command1.Caption =確定And Command2.Caption =取消Then 如果為“確定”則添加新用戶If Text1.Text = Then提示用戶輸入用戶名MsgBox 請輸入用戶名!,登錄信息提示:Exit SubElseDim usename As String檢測用戶名是否已經(jīng)存在Dim strS As Stringusename = Trim(Text1.Text)strS = select * from用戶登錄信息表where用戶名=&

6、; usename & ”,Adodc1.CommandType = adCmdTextAdodc1.RecordSource = strSAdodc1.RefreshIf Adodc1.Recordset.EOF = False ThenMsgBox 您輸入的用戶已存在!,登錄提示信息:Text1.Text =Text2.Text =Text3.Text =Text1.SetFocusText1.SetFocusExit SubExit SubEnd IfEnd IfIf Text2.Text = ThenTextl.Text =Text2.Text =提示用戶密碼不能為空MsgBo

7、x 密碼不能為空!,登錄提示信息:Text2.SetFocusExit SubEnd IfIf Text3.Text = ThenMsgBox 請?jiān)俅屋斎朊艽a!,登錄提示信息:Text3.SetFocusExit SubEnd IfIf Text2.Text Text3.Text ThenMsgBox 兩次輸入的密碼不一致,請確認(rèn)!,”登錄提示信息:Text2.Text =Text3.Text =Text2.SetFocusExit SubElseAdodc1.Recordset.AddNew添加新用戶Adodc1.Recordset.Fields(用戶名)=Trim(Text1.Text)A

8、dodc1.Recordset.Fields(密碼)=Trim(Text2.Text)Adodc1.Recordset.UpdateMsgBox (添加新用戶成功,現(xiàn)在您可以登陸系統(tǒng)了!)Label3.Visible = FalseText3.Visible = FalseCommand1.Caption =登錄“Command2.Caption = 退出“End IfElse“登錄”按鈕,用戶登錄Dim strSno As StringDim strSelect As StringstrSno = Trim(Text1.Text)檢測用戶名是否存在strSelect = select密碼fr

9、om用戶登錄信息表where用戶名=& strSno & ,Adodc1.CommandType = adCmdTextAdodc1.RecordSource = strSelectAdodc1.RefreshIf Adodc1.Recordset.EOF = True ThenMsgBox 用戶名不存在,請重新輸入!登錄提示信息:End IfIf Adodc1.Recordset.Fields(密碼)=Trim(Text2.Text) Then檢測密碼是否正確Forml.HideUnload MeForm2.ShowMsgBox 登陸成功!,登錄提示信息:ElseMsgBox

10、 密碼不正確,請重新輸入!,登錄提示信息:Text2.Text =Text2.SetFocusEnd IfEnd IfEnd SubPrivate Sub Command2_Click()“退出”或“取消”按鈕If Command2.Caption =取消ThenLabel3.Visible = FalseText3.Visible = FalseCommand1.Caption =登錄Command2.Caption =退出Text1.Text =Text2.Text =Text1.SetFocusElseEnd Unload MeEnd IfEnd SubPrivate Sub Comma

11、nd3_Click()“新用戶”按鈕Label3.Visible = TrueText3.Visible = TrueText1.Text =Text2.Text =Text3.Text =Command1.Caption =確定Command2.Caption =取消Text1.SetFocusEnd SubPrivate Sub Command3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Label6.Visible = TrueEnd SubPrivate Sub Command3_Mo

12、useUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Label6.Visible = FalseEnd SubPrivate Sub Form_Load()Label3.Visible = FalseFrame2.Visible = FalseEnd Sub顯示向左移動(dòng)的歡迎字幕If Label4.Left + Label4.Width 0 Then當(dāng)標(biāo)簽右邊位置大于0時(shí),標(biāo)簽向左移Label4.Move Label4.Left - 80否則標(biāo)簽從頭開始Label4.Left = Form1.ScaleWidt

13、hEnd IfIf Label5.Left + Label5.Width 0 ThenLabel5.Move Label5.Left - 80ElseLabel5.Left = Form1.ScaleWidthEnd IfEnd Sub主界面窗體如下:M Xif?l - Ei EU9iu L Tiaut;! Dusic I it M - XI J -(FPU】I代碼:Private Sub AddNew_Click()Frame1.Visible = TrueText3.Visible = FalseEnd SubPrivate Sub Timer1_Timer()時(shí)間timel控件的time

14、事件代碼,用來EEETriTklPIE1J11-PIE1J11-_1QI_1QIB BTai C l Trdl整字毋序rt肖 X11T-HELIAD - lr Juilitr頃#=i - nlWTr.-f WWXBMKi:u+iVkli iLKg-Ti irid EiariLriTruNZgUD-HuxOTrur*Firrol-, utuuunu3154LF:D 0TI-M*BEl:擊D da _C-H hLI .LukaKIJD - l.uLiaJiJiMiriic泊可代同甲ffi朝BT礎(chǔ)臨腌贏Else肘囪何IS漆國t皿,成 /i 315 S D-rtt) -E做函1曲尸量冊界面寶輝(函Jb

15、 FZhn:6 FM3曲尸曜景尊臼三f lQ心*L用尸株改密隊(duì)fi-fclifliB| J:下支 I -irr,.仆阿自Er!C-X4Adodc2.RecordSource = nPrivate Sub CHKPMCHX_Click()Frame2.Caption =出庫信息Dim pm As StringDim n As Stringpm = InputBox(產(chǎn)品名,請輸入,0)n = select * from出庫表where品名=& pm &小Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.Refr

16、eshCall InitGridlEnd SubPrivate Sub CHKXHCHX_Click()Frame2.Caption =出庫信息Dim XH As StringDim n As StringXH = InputBox(產(chǎn)品型號,請輸入,0)n = select * from出庫表where型號=& XH &小Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd SubPrivate Sub CKCZ_Click()Form2.HideForm6.ShowEnd SubPriv

17、ate Sub CKJSHR_Click()Frame2.Caption =出庫信息Dim JSHR As StringDim n As StringJSHR = InputBox(經(jīng)手人,請輸入,0)n = select * from出庫表where經(jīng)手人=& JSHR &小“Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGridlEnd SubPrivate Sub CKSHJ_Click()Frame2.Caption =出庫信息Dim CHKRQ As String

18、Dim n As StringCHKRQ = InputBox(出庫日期,格式為:月/日/年如:12/1/2011,請輸入,0) n = select * from出庫表where出庫日期=& CHKRQ &山Adodc2.CommandType = adCmdTextAdodc2.RefreshCall InitGridlEnd SubPrivate Sub CKZCX_Click()Frame2.Caption =出庫信息Dim ZB As StringZB = select * from出庫表Adodc2.CommandType = adCmdTextAdodc2.Rec

19、ordSource = ZBAdodc2.RefreshCall InitGridlEnd SubPrivate Sub Command1_Click()If Textl.Text = Then提示用戶輸入用戶名MsgBox 請輸入用戶名!,登錄信息提示:Exit SubElseDim usename As String檢測用戶名是否已經(jīng)存在Dim strS As Stringusename = Trim(Textl.Text)strS = select * from用戶登錄信息表where用戶名=& usename &山Adodcl.CommandType = adCmdTe

20、xtAdodcl.RecordSource = strSAdodcl.RefreshIf Adodc1.Recordset.EOF = False ThenMsgBox 您輸入的用戶已存在!,登錄提示信息:Textl.Text =Text2.Text = Text3.Text =Text1.SetFocusExit SubEnd IfEnd IfIf Text2.Text = Then提示用戶密碼不能為空MsgBox 密碼不能為空!,登錄提示信息:Text2.SetFocusExit SubEnd IfIf Text3.Text = ThenMsgBox 請?jiān)俅屋斎朊艽a!,登錄提示信息:Tex

21、t3.SetFocusExit SubEnd IfIf Text2.Text Text3.Text ThenMsgBox 兩次輸入的密碼不一致,請確認(rèn)門,登錄提示信息:Text2.Text =Text3.Text =Text2.SetFocusExit SubElseAdodcI.Recordset.AddNew添加新用戶Adodc1.Recordset.Fields(用戶名)=Trim(Text1.Text)Adodc1.Recordset.Fields(密碼)=Trim(Text2.Text)Adodc1.Recordset.UpdateDim X As IntegerX = MsgBox

22、(成功添加新用戶,是否要重新登錄!,vbYesNo + vbQuestion + vbDefaultButton1,提示信息!)If X = vbYes ThenUnload MeForm3.ShowEnd IfMsgBox (成功添加新用戶!)Label3.Visible = FalseText3.Visible = FalseCommand1.Caption =登錄Command2.Caption =退出End IfFrame1.Visible = FalseFrame2.Visible = TrueText1.Text =Text2.Text =”Text3.Text =Form3.Sh

23、owEnd SubPrivate Sub Command2_Click()Frame1.Visible = FalseFrame2.Visible = TrueEnd SubPrivate Sub CXDL_Click()Form3.ShowUnload MeEnd SubPrivate Sub Exit_Click()EndUnload Form1Unload Form2Unload Form3Unload Form4End SubUnload Form5Unload Form6Unload Form7Unload Form8End SubPrivate Sub Form_Load()Tex

24、tUserName = Trim(Form1.Text1.Text)Unload Form1Frame1.Visible = FalseCall InitGrid0Me.Height = MDIForm1.Height - 1060Me.Width = MDIForm1.Width - 560Me.Top = MDIForm1.TopMe.Left = MDIForm1.LeftEnd SubPrivate Sub GHCZ_Click()Form2.HideForm8.ShowEnd SubPrivate Sub GHPMCX_Click()Frame2.Caption =歸還信息Dim p

25、m As StringDim 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 StringDim n As StringJCR = InputBox(歸還人,請輸入,0)n = select * from

26、歸還表where歸還人=& JCR & ”Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2Private Sub GHSJCX_Click()Frame2.Caption =歸還信息Dim JCRQ As StringDim n As StringJCRQ = InputBox(歸還日期,格式為:月/日/年如:12/1/2011,請輸入,0) n = select * from歸還表where歸還日期=& JCRQ &小Adodc2.CommandT

27、ype = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub GHXHCX_Click()Frame2.Caption =歸還信息Dim XH As StringDim n As StringXH = InputBox(產(chǎn)品型號,請輸入,0)n = select * from歸還表where型號=& XH &小“Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2

28、End SubPrivate Sub 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 =借出信息Dim pm As StringDim n A

29、s Stringpm = InputBox(產(chǎn)品名,請輸入,0)Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCHXHCHX_Click()Frame2.Caption =借出信息Dim XH As StringDim n As StringXH = InputBox(產(chǎn)品型號”,請輸入”,0)n = select * from借出表where型號=& XH & Adodc2.CommandType = adCmdTextA

30、dodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JCRCX_Click()Frame2.Caption =借出信息Dim JCR As StringDim n As StringJCR = InputBox(借出人,請輸入,0)n = select * from借出表where借出人=& JCR & Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate

31、Sub JCSHJCX_Click()Frame2.Caption =借出信息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_Click()Frame2.Caption =借出信

32、息Dim ZB As StringZB = select * from借出表”Adodc2.CommandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid2n = select * from借出表where品名=& pm &小End SubPrivate Sub JSHRCHX_Click()Frame2.Caption =歸還信息Dim JSHR As StringDim n As StringJSHR = InputBox(經(jīng)手人”,”請輸入,0)n = select * from歸還表w

33、here經(jīng)手人=& JSHR & Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub JSHRCX_Click()Frame2.Caption =借出信息Dim JSHR As StringDim n As StringJSHR = InputBox(經(jīng)手人,請輸入,0)n = select * from借出表where經(jīng)手人=& JSHR & Adodc2.CommandType = adCmdTextAdodc2

34、.RecordSource = nAdodc2.RefreshCall InitGrid2End SubPrivate Sub PMCX_Click()Frame2.Caption =庫存信息Dim pm As StringDim n As Stringpm = InputBox(產(chǎn)品名,請輸入,0)n = select * from庫存表where品名=& pm & Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGridOEnd SubPrivate Sub RKCZ_C

35、lick()Form2.HideForm5.ShowEnd SubPrivate Sub RKJSHR_Click()Frame2.Caption =入庫信息Dim JSHR As StringDim n As StringJSHR = InputBox(經(jīng)手人,請輸入,0)n = select * from入庫表where經(jīng)手人=& JSHR &小Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGridlEnd SubPrivate Sub RKPMCHX_Click()F

36、rame2.Caption =入庫信息Dim pm As StringDim n As Stringpm = InputBox(產(chǎn)品名,請輸入,0)If Len(pm) 0 Thenn = select * from入庫表where品名=& pm &小Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGridlEnd SubPrivate Sub RKSHJ_Click()Frame2.Caption =入庫信息Dim RKRQ As StringDim n As

37、StringRKRQ = InputBox(入庫日期,格式為:月/日/年如:12/1/2011,請輸入,0) n = select * from入庫表where入庫日期=& RKRQ &山Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshCall InitGrid1End SubPrivate Sub RKXHCHX_Click()Frame2.Caption =入庫信息Dim XH As StringDim n As StringXH = InputBox(產(chǎn)品型號,請輸入,0)If Len(

38、XH) 0 Thenn = select * from入庫表where型號=& XH &小Adodc2.CommandType = adCmdTextAdodc2.RecordSource = nAdodc2.RefreshEnd IfCall InitGridlEnd SubPrivate Sub RKZCX_Click()Frame2.Caption =入庫信息Dim ZB As StringZB = select * from入庫表Adodc2.CommandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCal

39、l InitGridlEnd SubPrivate Sub Timer1_Timer()If Label4.Left + Label4.Width 0 Then移Label4.Move Label4.Left - 80ElseLabel4.Left = Form2.ScaleWidthEnd IfIf Label5.Left + Label5.Width 0 ThenLabel5.Move Label5.Left - 80ElseLabel5.Left = Form2.ScaleWidthEnd IfIf Label6.Left + Label6.Width 0 ThenLabel6.Move

40、 Label6.Left - 80ElseLabel6.Left = Form2.ScaleWidthEnd IfIf Label7.Left + Label7.Width 0 ThenLabel7.Move Label7.Left - 80ElseLabel7.Left = Form2.ScaleWidthEnd IfEnd SubPrivate Sub XGMM_Click()Form2.HideForm4.ShowEnd SubPrivate Sub XHCX_Click()Frame2.Caption =庫存信息當(dāng)標(biāo)簽右邊位置大于0時(shí),標(biāo)簽向左否則標(biāo)簽從頭開始End WithEnd S

41、ubDim 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 InitGrid0End SubPrivate Sub ZB_Click()Frame2.Caption =庫存信息Dim ZB As StringDim N As StringP

42、M = InputBox(產(chǎn)品名,請輸入”,0)ZB = select * from庫存表”where品名=& PM & Adodc2.CommandType = adCmdTextAdodc2.RecordSource = ZBAdodc2.RefreshCall InitGrid0End SubPrivate Sub InitGrid0()With DataGridl.Columns(0).Width = 1600.Columns(1).Width = 2200.Columns(2).Width = 2200.Columns(3).Width = 1000.Columns(

43、4).Width = 1000.Columns(5).Width = 4000End WithEnd SubPrivate Sub InitGrid1()With DataGrid1.Columns(0).Width = 800.Columns(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 = 4000Private Sub InitGrid2

44、()With DataGridl.Columns(0).Caption =學(xué)號”If Adodc1.Recordset.EOF = True Then.Columns(1).Caption =課程名.Columns(2).Caption =學(xué)分”.Columns (3) .Caption =成績”,設(shè)置DtgCond的列寬.Columns(0).Width = 800.Columns(1).Width = 1600.Columns(2).Width = 1600.Columns(3).Width = 800.Columns(4).Width = 800.Columns(5).Width = 8

45、00.Columns(6).Width = 1000.Columns(7).Width = 800.Columns(8).Width = 4000End WithEnd Sub用戶重新登錄界面代碼:Private Sub Command1_Click()Dim strSno As StringDim strSelect As StringstrSno = Trim(Text1.Text)檢測用戶名是否存在strSelect = select密碼from用戶登錄信息表where用戶名=& strSno &小Adodc1.CommandType = adCmdTextAdodc1.

46、RecordSource = strSelectAdodc1.RefreshText2.Text =Textl.SetFocusExit SubEnd IfIf Adodc1.Recordset.Fields(密碼)=Trim(Text2.Text) ThenUnload MeForm2.ShowMsgBox 登陸成功!,登錄提示信息:ElseMsgBox 密碼不正確,請重新輸入!,登錄提示信息:Text2.Text =Text2.SetFocusEnd IfEnd SubPrivate Sub Command2_Click()Unload MeForm2.ShowEnd Sub修改用戶密碼界

47、面代碼:Private Sub Command1_Click()If Trim(Text1.Text) Form2.TextUserName ThenMsgBox 用戶名不正確,請確認(rèn)!,信息提示!Text1.Text =Text1.SetFocusExit SubElseDim name As StringDim names As String name = Trim(Textl.Text)MsgBox Textl.Text =用戶名不存在,請重新輸入!登錄提示信息:檢測密碼是否正確names = select * from用戶登錄信息表where用戶名=& name & A

48、dodcl.CommandType = adCmdTextAdodc1.RecordSource = namesAdodc1.RefreshIf Text2.Text = ThenMsgBox 請輸入舊密碼門,信息提示!Text2.SetFocusExit SubEnd IfIf Adodc1.Recordset.Fields(密碼) Trim(Text2.Text) ThenMsgBox 舊密碼不正確,請確認(rèn) 門,信息提示!Text2.Text =Text2.SetFocusExit SubEnd IfIf Text3.Text = ThenMsgBox 請輸入新密碼門,信息提示!Text3

49、.SetFocusExit SubEnd IfIf Text4.Text = ThenMsgBox 請?jiān)俅屋斎胄旅艽a門,信息提示!Text4.SetFocusExit SubEnd IfIf Trim(Text3.Text) Trim(Text4.Text) ThenMsgBox 兩次輸入的新密碼不一致 門,信息提示!Text3.Text =Text4.Text =Text3.SetFocusExit SubElseAdodc1.Recordset.Fields(密碼)=Trim(Text3.Text)Adodc1.Recordset.UpdateMsgBox (密碼修改成功!)Unload

50、MeForm2.ShowEnd IfEnd IfEnd SubPrivate Sub Command2_Click()Unload MeForm2.ShowEnd Sub入庫管理代碼:Private Sub Command1_Click()If Text1.Text = And Text2.Text = ThenMsgBox “品名”和“型號”不能同時(shí)為空,必須輸入其中一項(xiàng)!,提示信息Exit SubText1.SetFocusElseIf Text3.Text = And Text4.Text = ThenMsgBox 請輸入產(chǎn)品“數(shù)量”或“單位”之一Text3.SetFocusExit S

51、ubEnd IfIf Text5.Text = ThenMsgBox 請經(jīng)手人簽名!,vbCritical,提示信息Text5.SetFocusExit SubEnd IfAdodc1.RefreshAdodc1.Recordset.AddNewAdodc1.Recordset.Fields(Adodc1.Recordset.Fields(Adodc1.Recordset.Fields(Adodc1.Recordset.Fields(Adodc1.Recordset.Fields(Adodc1.Recordset.Fields(Adodc1.Recordset.Fields(品名)=Trim(

52、Text1.Text)型號)=Trim(Text2.Text)數(shù)量)=Trim(Text3.Text)單位)=Trim(Text4.Text)經(jīng)手人)=Trim(Text5.Text)入庫日期)=Date說明)=Trim(Text7.Text)提示信息添加Exit SubAdodcI.Recordset.UpdateEnd IfDim pm As StringDim pms As StringDim n As StringDim m As Stringpm = Trim(Textl.Text)n = Val(Text3.Text)pms = select * from庫存表where品名=&a

53、mp; pm & ”Form2.Adodc2.CommandType = adCmdTextForm2.Adodc2.RecordSource = pmsForm2.Adodc2.RefreshIf Form2.Adodc2.Recordset.EOF ThenWith Form2.Adodc2.Recordset.AddNew.Adodc2.Recordset.Fields(.Adodc2.Recordset.Fields(.Adodc2.Recordset.Fields(.Adodc2.Recordset.Fields(.Adodc2.Recordset.Fields(.Adodc

54、2.Recordset.UpdateEnd WithElsem = Form2.Adodc2.Recordset.Fields(If Form2.Adodc2.Recordset.Fields(Form2.Adodc2.Recordset.Fields(Form2.Adodc2.Recordset.UpdateEnd IfEnd If品名)=Trim(Textl.Text)型號)=Trim(Text2.Text)數(shù)量)=Trim(Text3.Text)單位)=Trim(Text4.Text)說明)=Trim(Text7.Text)數(shù)量).Value型號)=Trim(Text2.Text) Th

55、en數(shù)量)=Val(m) + Val(n)Dim X As IntegerX = MsgBox(產(chǎn)品入庫登記成功,是否繼續(xù)添加產(chǎn)品!,vbYesNo + vbQuestion + vbDefaultButtonl,If X = vbNo ThenUnload MeForm2.ShowElseTextl.Text =Text2.Text =Text3.Text =Text4.Text =Text5.Text =Text6.Text =Text7.Text =Textl.SetFocusEnd If提示信息!)Form2.Frame2.Caption =入庫信息Dim ZB As StringZB

56、 = select * from入庫表where品名=& PM & ”“Form2.Adodc2.CommandType = adCmdTextForm2.Adodc2.RecordSource = ZBForm2.Adodc2.RefreshEnd SubPrivate Sub Command2_Click()Text1.Text =Text2.Text =Text3.Text =Text4.Text =Text5.Text =Text6.Text =Text7.Text =Text1.SetFocusEnd SubPrivate Sub Command3_Click()Un

57、load MeForm2.ShowEnd Sub出庫管理代碼:Private Sub Command1_Click()If Combo1.Text = And Combo2.Text = Then text1.Text = And Text2.Text = ThenMsgBox ”“品名”和“型號”不能同時(shí)為空,必須輸入其中一項(xiàng)!,提示信息Exit SubElseIf Text1.Text = And Combo3.Text = Then Text4.Text = ThenMsgBox -請輸入產(chǎn)品“數(shù)量”或“單位”之一!,”提示信息!Text2.SetFocusExit SubAdodc1.

58、Recordset.UpdateEnd IfDim pm As StringDim pms As StringDim n As StringDim m As String pm = Trim(Combo1.Text)n = Val(Text1.Text)Form2.Adodc2.CommandType = adCmdTextForm2.Adodc2.RecordSource = pmsForm2.Adodc2.Refreshm = Form2.Adodc2.Recordset.Fields(Form2.Adodc2.Recordset.Fields(Form2.Adodc2.Recordset

59、.UpdateEnd IfDim X As IntegerX = MsgBox(產(chǎn)品出庫登記成功,是否繼續(xù)添加產(chǎn)品!,vbYesNo + vbQuestion + vbDefaultButtonl,If X = vbNo ThenUnload MeForm2.ShowEnd IfCombol.Text =Combo2.Text =Combo3.Text =Textl.Text =Text2.Text =Text3.Text =End IfIf Text2.Text = ThenMsgBox 請經(jīng)手人簽名!, vbCritical,提示信息Text2.SetFocusExit SubEnd If

60、Adodc1.RefreshAdodc1.Recordset.AddNew添加Adodc1.Recordset.Fields(品名)=Trim(Combo1.Text) Trim(Text1.Text)Adodc1.Recordset.Fields(型號)=Trim(Combo2.Text) Trim(Text2.Text)Adodc1.Recordset.Fields(數(shù)量)=Trim(Text1.Text)Adodc1.Recordset.Fields(單位)=Trim(Combo3.Text) Trim(Text4.Text)Adodc1.Recordset.Fields(經(jīng)手人)=Trim(Text2.Text)Adodc1.Recordset.Fields(出庫日期)=DateAdodc1.Recordset.Fields(說明)=Trim(Text4.Text)pms = select * from庫存表where品名=& pm & ”數(shù)量).ValueIf Form2.Adodc2.Recordset.Fields(型號)=Trim(Combo2.Text) Then數(shù)量)=Val(m) - Val(n)提示信息!

溫馨提示

  • 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)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論