How to use autolookup

  • Thread starter Thread starter Newsgroups
  • Start date Start date
N

Newsgroups

I have three fields:
User ID, User name and user surname.

In a form I want the fields, user name and user surname to be filled in
using an autolookup, when the user id field is filled in (using a standard
lookup)
 
Either have a combo box with the 3 fields in as 3 columns and then the
control source of 2 text fields can be set to
=ComboBoxName.Column(1)
=ComboBoxName.Column(2)

or set the control source of the 2 text fields to

=DLookUp("UserName","UserTable","UserID = " & UserIDBox)
=DLookUp("UserSurname","UserTable","UserID = " & UserIDBox)

If UserID is text and not numeric then it should look like this

=DLookUp("UserName","UserTable","UserID = '" & UserIDBox & "'")
=DLookUp("UserSurname","UserTable","UserID = '" & UserIDBox & "'")
 
Back
Top