Inputbox (1 Viewer)

legendv

Registered User.
Local time
Today, 08:51
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?
 

Mile-O

Back once again...
Local time
Today, 08:51
Joined
Dec 10, 2002
Messages
11,316
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
 

legendv

Registered User.
Local time
Today, 08:51
Joined
Mar 18, 2002
Messages
99
Mile,
You are wonderful!
Thanks!
Jon
 

Users who are viewing this thread

Top Bottom