Comments inline:
> Here is the code:
> Private Sub Text85_Enter()
[quoted text clipped - 9 lines]
>
> End Sub
It looks like you're really not doing anything. The end is the same result,
it goes back to the textbox, because you're not telling it not to when the
password is incorrect. You need to add a line of code to move the focus away
from that textbox whenever the password is incorrect, something like:
Me![Text83].SetFocus
That way the user has to click back on the box again to get the password
screen. Also, your GoToControl command is pointless, once you've clicked on
the textbox, that control will have the focus. So if the password is correct,
that control will already be selected, which is also why you're having the
problem with the incorrect password.
Personally, I would change that textbox to being disabled, and enabling it
only if the password is correct through an OnClick event:
Private Sub Text85_Click()
Dim Password, Loggin
Password = "Query"
Loggin = InputBox("Enter password")
If Loggin <> Password Then
MsgBox "Sorry wrong password!!"
Else
Me![Text85].Enabled = True
Me![Text85].SetFocus
End If
End Sub
Just remember that you'll have to reset your control to Enabled = False
somewhere else in your code.
> > Please post the code for the text box (I'm assuming you're using the OnClick
> > event?), it will be much easier to help you if we can see the code.
[quoted text clipped - 12 lines]
> > > Thanks
> > > Linda
Nicholas Scarpinato - 24 Mar 2008 21:08 GMT
Bah... nevermind, setting it to Enabled = False won't work, the OnClick event
won't fire if the control is disabled. Sorry.
But changing the focus on the form will work for your original code.
> Comments inline:
>
[quoted text clipped - 59 lines]
> > > > Thanks
> > > > Linda
Linda - 26 Mar 2008 16:13 GMT
Thanks!! That worked!!!
> Comments inline:
>
[quoted text clipped - 59 lines]
> > > > Thanks
> > > > Linda