Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Example Code? (XP)

    Could someone post a short (but expandable) example of the code I would attach to a text box/command button that depending on what password is entered in the box, it directs you to a specific form? I've got an If Then attached to the cmd button that looks at the word in the text box, however when I try to add another If Then, it will only go to the default (blank text box) error message.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Example Code? (XP)

    Why don't you post the code you're trying? Then one of us can suggest how to fix it. That would mean more to you than an abstract example.
    Charlotte

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Example Code? (XP)

    You should be better with a Select case instead of different If Then Else
    Select Case Me.txtPasswordTextBox
    Case "ABC"
    Docmd.OpenForm "ABC"
    Case "DEF"
    Docmd.OpenForm "DEF"
    Case Else
    MsgBox "Wrong Password"
    Application.Quit
    End Select
    Francois

Posting Permissions

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