RE: show record based on selection from combo box
- From: smboyd <smboyd@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Jul 2005 11:56:01 -0700
Ok - I think I understand that, but where would the address, city, state,
phone, etc. be displayed if they are all included in the row source of the
2nd combo box. I would like for them to be displayed in a different section
"field" of the form.
"Sprinks" wrote:
> Hi, smboyd.
>
> By "fill in", I presume you mean to display the useful phone, fax, etc., and
> not STORE it redundantly in the RecordSource of the current form. You need
> only store the Owner and Owner Contact ID's.
>
> I will assume a table structure like this:
>
> T_Owner
> T_OwnerID AutoNumber or Integer (Primary Key)
> ContactName Text
> ...
>
> T_Owner Contact
> T_OwnerContactID AutoNumber or Integer (Primary Key)
> T_OwnerID Integer (Foreign Key to T_Owner)
> ContactName Text
> ...
>
> I will also assume that the T_Owner and T_Owner Contact combo boxes on your
> form *display* the name but store the numeric code, i.e., the Column Count =
> 2, the Bound Column = 1, the ColumnWidths = 0";x", x being some number.
>
> Include any field you wish to display on the form in the RowSource property
> of the 2nd combo box (you can use the wizard to do this). To limit the list
> to those corresponding to only those associated with the current owner, add a
> WHERE clause to the Row Source statement:
>
> SELECT T_Owner Contact.T_Owner ContactID, T_Owner Contact.ContactName,
> T_Owner Contact.Address, T_Owner Contact.City, T_Owner Contact.State, T_Owner
> Contact.Phone
> FROM T_Owner Contact
> WHERE T_Owner Contact.OwnerID = Me!YourOwnerIDComboBox;
>
> You will need to requery the combo box each time the owner changes, or the
> user moves to another record (the first combo box' AfterUpdate event
> procedure and the form's OnCurrent event procedure):
>
> Me!MySecondComboBox.Requery
>
> Hope that helps.
> Sprinks
>
> "smboyd" wrote:
>
> > I have 2 tables T_Owner and T_Owner Contact. Each owner may have 1-5
> > different contacts. I would like the user to select which owner from a combo
> > box and then be able to pick which contact from a another combo box - and
> > have the address, phone, etc for that contact filled in as applicable. Any
> > help would be appreciated.
.
- Follow-Ups:
- RE: show record based on selection from combo box
- From: Sprinks
- RE: show record based on selection from combo box
- References:
- show record based on selection from combo box
- From: smboyd
- RE: show record based on selection from combo box
- From: Sprinks
- show record based on selection from combo box
- Prev by Date: RE: Make a label "flash" on a form
- Next by Date: RE: Conditional Formatting
- Previous by thread: RE: show record based on selection from combo box
- Next by thread: RE: show record based on selection from combo box
- Index(es):
Relevant Pages
|