Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Unanswered: VB Code for a login Form

    Hello everyone I'm currently a student creating a rather basic database for my A2 ICT coursework.

    Now what I would like to know how to do is to create a login menu that can be used to prevent access to a Main Menu.

    (A form with lots of command buttons leading to queries/forms)

    I really need some security placed within my database and I thought that this would be the ideal method of security as I'm sure it involves Visual Basic.

    I've seen an example of what I'm wanting on this forum. I believe it is here

    Ideally if I can have the VB code for the example shown at the bottom of the thread that would be fantastic.

    Also How would I get the login form used for a different form and not when I open the database?

  2. #2
    Join Date
    Nov 2003
    For the last bit of your post...first off..make a PopUp password entry form then set this form (in Access) to be your startup form. In the OnClose event of you Login form enter this line of code:
    If IsNull(Me.myPasswordTxtBx) or Me.PasswordTxtBx = Null then DoCmd.Quit
    You can call up this form any time within your database. For Example, If you what this Login form to popup when you open a specific form then you can place this code into OnOpen event of the form you want to open:

    DoCmd.OpenForm "myLoginFom", , , , , , acDialog

    Hope this helps

Posting Permissions

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