Re: Fill in fields
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 13 Jan 2006 11:15:49 -0700
On 13 Jan 2006 08:33:52 -0800, k.roberts@xxxxxxxxxx wrote:
>I want to fill in 2 fields - [Email] 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.
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!
>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.
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]
.
- References:
- Fill in fields
- From: k . roberts
- Fill in fields
- Prev by Date: Re: 2 invoices with same # auto linked need formula?
- Next by Date: Re: Populating data from a form to a subform
- Previous by thread: Fill in fields
- Next by thread: Invalid Argument Error On A Select Query
- Index(es):
Relevant Pages
|