Fill in fields

K

k.roberts

I want to fill in 2 fields - and [Telephone] according to data
filled in Presenter combo box.

The table t_WP Presenters contains the records - Presenter, Email and
Telephone.

I want to put code behind the OnUpdate or OnExit event of the Presenter
combo box that will lookup the Presenter name in the table, and return
the Email and Telephone into 2 other combo boxes on the form.

I have tried some sample code found on the web but not having much luck
as it is just returning the 1st record details rather than looking up
the appropriate presenter.

Help!
 
J

John Vinson

I want to fill in 2 fields - and [Telephone] according to data
filled in Presenter combo box.

The table t_WP Presenters contains the records - Presenter, Email and
Telephone.

I want to put code behind the OnUpdate or OnExit event of the Presenter
combo box that will lookup the Presenter name in the table, and return
the Email and Telephone into 2 other combo boxes on the form.[/QUOTE]

Why?

Storing this information redundantly in a second table is simply
unnecessary, and bad design. What's the point of using a combo box for
a fixed value? A user won't be *selecting* anything from this combo!
[QUOTE]
I have tried some sample code found on the web but not having much luck
as it is just returning the 1st record details rather than looking up
the appropriate presenter.[/QUOTE]

No code whatsoever is needed to *display* the Email and Phone on your
current form. Simply include these two fields in the combo box's
RowSource query; put textboxes (not combos) on the form, with Control
Source

=comboboxname.Column(n)

using the name of your combo box; n is the *zero based* subscript of
the field in the query (e.g. if the email address is the fourth field
in the combo box, use (3)).

John W. Vinson[MVP]
 

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