Page 4 of 8 FirstFirst ... 23456 ... LastLast
Results 46 to 60 of 109

Thread: How to create user login form (MS Access 2000 - 2003)

  1. #46
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    In the module mod_display_menu

    Select Case valid_user

    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.
    Allan

  2. #47
    Join Date
    Dec 2008
    Posts
    27
    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)

  3. #48
    Join Date
    Dec 2008
    Posts
    27
    i played around with it and still haven't firgured out where I need to put the line to fix it.

    i put compressed it with rar, then put it in a zip so I could attach it


    thanks again!
    Attached Files Attached Files

  4. #49
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    In your code for form Table2 you can not have Me!user_id = Forms!frm_utility!user_id outside the Sub and End Sub

    Change the code in your form Table2 to read as below.

    Option Compare Database

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    Me![ModifiedDate].Value = Now()
    Me![ModifiedBy].Value = Forms!frm_utility!user_id
    End Sub
    Allan

  5. #50
    Join Date
    Dec 2008
    Posts
    27
    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.

  6. #51
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    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.
    Allan

  7. #52
    Join Date
    Dec 2008
    Posts
    27
    i don't see an attachment, did you update the one in post 44?

  8. #53
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    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

  9. #54
    Join Date
    Dec 2008
    Posts
    27
    email sent

  10. #55
    Join Date
    Dec 2008
    Posts
    27
    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.

    thanks

  11. #56
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    Please post a zip copy of your database and I will look at it.
    Allan

  12. #57
    Join Date
    Dec 2008
    Posts
    27
    too big, will email it.

  13. #58
    Join Date
    Jan 2009
    Posts
    1
    Hi Allan,

    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!

    Sarah

  14. #59
    Join Date
    May 2010
    Posts
    1
    Quote Originally Posted by meLady View Post
    Hello,

    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

  15. #60
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275
    Read the messages and at message 45 is a demo version. Please contact me if you require more information.
    Allan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •