Re: Inputbox maybe?
From: George Nicholson (JunkGeorgeN_at_msn.com)
Date: 08/25/04
- Next message: Paul Scott: "Last Record"
- Previous message: John Vinson: "Re: Is it OK if I delete an record, then rewrite in table"
- In reply to: John: "Inputbox maybe?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Aug 2004 13:19:52 -0500
Untested aircode. Using just the Input Box, this relies on the user actually
typing "Cancel" (or the correct password) to exit the loop.
Sub InputPassword(strPassword as string)
Dim bolOK as Boolean
Dim strResult as String
bolOK = False
Do
strResult = Trim(InputBox("Please enter the Password or Type CANCEL to
abort:","Enter Password"))
Select Case strResult
Case "CANCEL", "Cancel", "cancel")
' Code to exit back to Previous form
GoTo ExitSub ' *NOT* "Exit Do"
Case Else
If strResult = strPassword then
bolOK = True
Else
' Do nothing: code will loop and repeat the InputBox
End If
End Select
Loop While bolOK = False
' ......Code that allows access goes here
' (correct password must have been entered to have gotten here)
ExitSub
-- George Nicholson Remove 'Junk' from return address. "John" <j> wrote in message news:uWR$8nqiEHA.2180@TK2MSFTNGP10.phx.gbl... > I have a form with a command button that opens another form. What I would > like to do is when the user clicks on the button, as box appears asking to > enter the pasword. The user will all ready know the password. If the > password is entered wrong I would like the user to be given two choices. One > to re-enter the password, which if is correct will go ahead and open the > form. The second choice will be cancel which will return back to the > previous form. I have tried several variations of the inputbox, msgbox's and > am not able to make it work right. My form names are CustInfo, CustAdm. > Please help I need working code. > > Thanks > >
- Next message: Paul Scott: "Last Record"
- Previous message: John Vinson: "Re: Is it OK if I delete an record, then rewrite in table"
- In reply to: John: "Inputbox maybe?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|