RE: show record based on selection from combo box

Tech-Archive recommends: Fix windows errors by optimizing your registry



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



Relevant Pages

  • Re: How to force a page to be into a frame?
    ... >> What you are trying to do is display an external Web page contrary ... >> to the way the owner of that page wants it to be displayed. ... Does it mean that you can bring an action against google? ...
    (comp.infosystems.www.authoring.html)
  • Re: Need Subform to automatically display 20 rows based on an ID f
    ... I did this using a Cartesian Product query, ... the "owner" table and the Product table, did NOT join them, selected the ... a set of "records" I could use for display in a form. ... >>> subform ...
    (microsoft.public.access.gettingstarted)
  • Re: Need help in calculating digital cameras MP
    ... However, in this case, the owner appears NOT to be happy. ... You may not be able to be precise and definitive, but my feeling is that in this case you can answer the question: If I have a 5-6-7MP camera, is that good enough for HDTV? ... I know that our pictures even on a 26-inch 1360 x 1080 display look very good indeed (viewed from about 8 times picture height). ...
    (rec.photo.digital)
  • Re: Display owner of a folder, file, etc.
    ... Is there a way to display the names of the file owners, ... under his account name? ... select to display the owner of a folder/file only the name of the ... Owner is not the same as Creator. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: File System Mangement
    ... I am trying to make a filesystem management script. ... > display a list of files and directories and be able to delete them from ... type - File type ... owner - Owner ...
    (comp.lang.php)