![]() ![]() ![]() ![]() MsgBox "Welcome to The System!", vbInformation, "Log-in Success" If Text2.Text = rs!Password And Text1.Text = rs!UserName Then 'Use the same when you are adding stock, just mark 'To get a value or deduct an item, the following. 'rs.Open "SELECT * FROM INVENTORY WHERE ItemNameHere LIKE '" & Text1.Text & "%'", db, adOpenStatic, adLockOptimistic 'Search for all items say starting with W, which will show say wires, wood etc. 'rs.Open "SELECT * FROM INVENTORY WHERE ItemNameHere = '" & Text1.Text & "'", db, adOpenStatic, adLockOptimistic 'The following sql statements can be used in your other forms. Rs.Open "select * from login where username = '" & Text1 & "'", db, adOpenStatic, adLockOptimistic MsgBox "Data required, please enter a valid username and password!", vbCritical, "Log-in Error"ĭb.Open "PROVIDER=.4.0 Data Source=" & App.Path & "\database1.mdb" If Text1.Text = vbNullString And Text2.Text = vbNullString Then 'we do not use "" '# Set a reference to MS ActiveX data objects first before ADO can be used!! I must just iterate again, we normally do not rewrite code for posters, you did however do a lot of coding from your side, no harm no foul. When done, please mark this as solved, found at the end of this page.:) I gave you all the other scenarios on how to control the stock etc. Delete all your data controls and start making use of ADO as in the code below. This is how you would handle all the other forms. I have not corrected all your code in your forms, only in form 2. Only because I'm in a good mood today!!!! ) ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |