Re: Fill in fields



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]
.



Relevant Pages

  • Re: Of Java and C#
    ... A standard OO Design Pattern for this example does exist called: ... Seeinginteracting with (Presenter) and changing the database ... and a Book knowing it checkout history is one of them.... ...
    (comp.lang.cobol)
  • Presenter View - nothings ever simple
    ... I'm trying to understand why one even needs Presenter view if it's possible ... design view on your laptop, ... view with my handi-dandy Interlink Navigator remote - I need to buy the more ...
    (microsoft.public.powerpoint)
  • Fill in fields
    ... I want to put code behind the OnUpdate or OnExit event of the Presenter ... Prev by Date: ...
    (microsoft.public.access.formscoding)