Autopopulated field in form

C

Caroline

I have a form that displays data from several tables. I want one of the
fields to populate the phone number when the reviewer is picked in another
field. E.g.: if I pick reviewer "Jeff" in the available list of reviewers, I
want Jeff's phone number to populate automatically in the field "phone" next
to it (this info is stored in the reviewers table).
Thanks,
Caroline
 
M

Mike Painter

Caroline said:
I have a form that displays data from several tables. I want one of
the fields to populate the phone number when the reviewer is picked
in another field. E.g.: if I pick reviewer "Jeff" in the available
list of reviewers, I want Jeff's phone number to populate
automatically in the field "phone" next to it (this info is stored in
the reviewers table).
Thanks,
Caroline

If the tables are properly related this is simply a matter of building the
form on a query that includes Jeff's phone number, name and UniqueID.
Jeff would be picked from a combobox.

If this can't be done in this way you could use dLookup.
While there are a *very* few reasons why this might be needed, it usually
implies poor design.
 
B

Beetle

If you just want to display the phone number on your form
you can do so in an unbound text box. You should *not* try
to actually store the value in another table.

When you say you are "picking" the reviewer, I assume you are
using a combo box. If you add the phone number field as an
additional column in the Row Source query of the combo box, and
set the Column Count and Column Widths properties of the combo
box accordingly, you can use the Column property of the combo
box to retrieve the phone number an display it in an unbound
text box. The Control Source of the unbound text box would
look like;

=[YourComboBox].Column(n)

where n is the numeric value of the column in the combo box
Row Source query. It is a zero based index, so the first Column
is Column(0), the second is Column(1), etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top