Return the result of a query to a control box in an UNBOUND form.

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

I have an unbound form that is used for user
authentication. The user enters a login id and a password
into unbound control boxes.

I have a query that references these values via an event
macro and returns a true/false value.

In order for my succeeding macros to function properly, I
need to be able to refer to the true/false result from
within my macro criteria, so that I can dictate which
succeeding macro to execute. Currently, when trying to
reference the result of that query, I receive an error
message stating that the "Automation Object" doesn't
exist. Any help is much appreciated. Please note that my
visual basic knowledge is very limited. Thanks in advance.
 
Just a suggestion cause it seems you are going about it the hard way with
macros checking values, yuk macros dont like-em...

Simple place a list box on your form with the user names and passwords from
your user table and hide the column with the password in it. The user then
simply selects there name from the list box then the next tab stop should be
the unbound text box where they enter there password, you then create the
code in the after update event of the unbound textbox to lookup the password
in the hidden column of the list box and thats it...

Private Sub afterupdate()
' The first colum of a list box is referenced as 0 not 1
If listbox.column(1) = unbound text box then
msgbox "Password Ok"
else
msgbox " Password Wrong"
End if

end sub

Hey, it might help you...

sin
 
Back
Top