Results 1 to 9 of 9
  1. #1
    avworx is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    9

    MsgBox with a password option?!!

    Could it be possible to have a msg box that will have an option to input a password for the code to procede to the next action?
    say for example I have a combobox with options A, B, and C. Option A and B could be selected without password, but option C could be selected only by ppl who knows the password otherwise the combobox stays at the option A or B.
    Ideally I would like following flow of events:


    by default option A or B is selected in a form, then
    1. User attempts to select option C, msgbox shows up and has option to entry the password or cancel button to proceed further.
    2. User enters the password, and if it is correct combobox changes it status to C, other wise status remain with previous options A or B.

    Thanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Not that I know of with a message box, but you could use InputBox() or a solution like this to let the user enter a password:

    http://www.baldyweb.com/WrappedForm.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    avworx is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    9
    thanks for the reply, yep input box worked out perfect. Now I have a code question.
    how would I refer to the value inputed in the input box?
    say for example:
    inputbox ("please enter the password!!!")
    if inputbox.value = "abc" then ... ( I know that this code wont work, but it gives u an idea of what i want to refer to)
    else
    msgbox ("input correct password!!!")
    end if

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Either of two methods. Set a variable:

    VariableName = InputBox(...)
    If VariableName = "Whatever" Then

    or use it directly:

    If InputBox(...) = "Whatever" Then
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    avworx is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    9
    @ pbaldy, thank you a lot yr advice helped a lot. Now I need to find a solution so users cant type anything into combobox

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help. If you set the Limit to List property of the combo to Yes, users will only be able to select from existing options.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    avworx is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    9
    yep, did that already. Thanks a lot!!! how difficult it would be to make the characters in the inputbox appear as dots or stars?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Personally I would use the method in my link, but I've also heard about this:

    http://www.tek-tips.com/faqs.cfm?fid=4617
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    avworx is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    9
    alright, thanks, I'll work on the hiding the password later. Thanks again!!!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. MsgBox Placement
    By tpcervelo in forum Programming
    Replies: 2
    Last Post: 12-27-2010, 07:36 AM
  2. Custom MsgBox
    By roccoIT in forum Programming
    Replies: 3
    Last Post: 07-06-2010, 10:43 AM
  3. Yes No Cancel MsgBox
    By Rick West in forum Forms
    Replies: 5
    Last Post: 04-14-2010, 08:57 AM
  4. no option to import xls file or option all files
    By captgnvr in forum Import/Export Data
    Replies: 3
    Last Post: 09-22-2009, 10:19 AM
  5. Change from old password to new password
    By richy in forum Security
    Replies: 0
    Last Post: 11-17-2005, 05:05 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums