Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2015
    Posts
    2

    Unanswered: Embed Message Box with password in button

    Hi there

    I have a button on my main menu that open a query. I want that button when 'on click' for the message box to pop up and the user has to enter a password that I have set up in a table.

    What is the best way to do that?

    I know there are a couple of steps - like creating the message box? or would InputBox work for this?

    Only an intermediate developer with access - so I know all you experts will have the right solution for me

    Thanks so much

    Lynn

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Yes, you'd want InputBox rather than a message box. Generally:

    If InputBox("Blah") = "ActualPassword" Then

    You could use a DLookup() or recordset to get the password from the table instead of hard-coding it like that. Rather than InputBox I tend to use a form:

    http://www.baldyweb.com/WrappedForm.htm
    Paul

  3. #3
    Join Date
    Feb 2015
    Posts
    2

    Extra help

    Hi Paul
    Thanks for replying. I am afraid I am less capable of getting this up than you may think....

    I tried to understand the whole wrapped form explanation but on that site - I understand the concept of an inputbox - just never created one.

    Tried doing some google searches, but didn't find much.

    Well, hate to bother you too much....unless you would like to walk me through some further details?

    Thanks again

    Lynn





    Quote Originally Posted by pbaldy View Post
    Yes, you'd want InputBox rather than a message box. Generally:

    If InputBox("Blah") = "ActualPassword" Then

    You could use a DLookup() or recordset to get the password from the table instead of hard-coding it like that. Rather than InputBox I tend to use a form:

    http://www.baldyweb.com/WrappedForm.htm

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Sorry Lynn, didn't get an email notification of your reply. Not sure what you need help with, as I gave you the basic code. To carry it further:

    Code:
    If InputBox("Enter password") = DLookup("PasswordField", "PasswordTable") Then
      'run your process
    Else
      MsgBox "Wrong password!"
    End If
    Paul

Posting Permissions

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