Inputbox

legendv

Registered User.
Local time
Today, 10:43
Joined
Mar 18, 2002
Messages
99
On the doubleclick event I have an input box that asks for a password.

I want the form to open if inputbox = txtPassword and cancel if it doesn't.

I can't seem to "call" the inputbox string.

In the Open event looks something similar...

if txtpassword.text = inputbox.text then
'do nothing
else
docmd.close
form_frmMainMenu.visible = true
endif

How do you "call"/"recall" the inputbox's string that was entered?
 
Code:
Dim strResponse as String

strResponse = InputBox("What is the password?","Logging in")

If strResponse <> txtPassword Then
   MsgBox "Sorry, wrong password. This database will now close.", vbCritical, "My Database"
   DoCmd.Quit
Else
   DoCmd.OpenForm "frmMainMenu", acNormal
EndIf
 
Mile,
You are wonderful!
Thanks!
Jon
 

Users who are viewing this thread

Back
Top Bottom