Case 2
' open and hide the utility form frm_utility
' this form will be used to store the user id for as required e.g recording the user id of an user adding records etc.
DoCmd.OpenForm "frm_utility", , , , , acHidden
This code opens a form frm_utility and hides it. When the menu screen opens the Login screen closes.
To store the user id you need to do the following
me!user_id =forms!frm_utility!user_id
change me!user_id to your variable name etc.
Message #44 has the latest version with the frm_utility
Last edited by Allan Murphy; 12-18-2008 at 05:50 PM.
ok, so I'm a dufus, I saw the lines you were talking about (after I downloaded v3) I looked at the utility and it shows the user I logged in as. I tried the modified line in my event proceedure but it wouldn't let me save the record or anything. I had to take the line back out.
(i zipped it but it's like 108k so it wouldnt attach)
yeah I tried that first, I kept getting error:
The expression Before Update you entered as the event property setting produced the following error: Invalid Outside proceedure
I figured I did something wrong and tried different ways in different places.
By having the code outside the SUB you will get that error message.
I have attached an updated version with the correct code. The User Name and Password is FRED. I have placed a menu item to open the form Table2. Try it and let me know if there are any problems.
Sorry, I did not realise that the attachement was over the limit before I sent it.
Please send your email address to my email address below and I will send you the zip file. Alternatively I will add the form Table2 as a zip file to this thread.
Allan,
I am still playing with this. I was trying to test the login after I have made some other forms and changed the switchboard to those forms. Now I get the login prompt, when I login the switchboard flashes and then goes away. I also tried the password change form, I can change the password but the exit doesnt work it will never exit the form.
I can't see anything wrong, I didn't change any of that code.
I'm a student, and I am attempting a project in Microsoft Access 2000. I have to create a user login form. I must use the username and passwords from a table and accordingly either allow access to the main menu or deny access. However, I am supposed to do this using macros. How can i do this?
I have a few more problems i encountered while doing this project, such as displaying an error message when the incorrect info is typed in, or clearing the text box after it is used.
i am very new at this, i hope you can help me! sorry for all the trouble and thank you very much!
I have a table called "users", it has two fields "username" and "password".
I have a form called "User Login Form". It has two text boxes and a button as following:
1- txtUsername
2- txtPassword
3- btnEnter
I would like to link these textboxes with a table. The idea is that the user must enter his/her username & password in the mentioned text boxes. Then, the user will press the enter button.
So the system will varify the input, if it not correct the error message will appear. If it correct, then the required form will be displayed (^_^).
this process is very new for me and I would like to learn it and I would be more appreciate with your kindly assistance.
but how to link user name text field to table text fied