Another Question

  • Thread starter Thread starter Maltese
  • Start date Start date
M

Maltese

Guest
Greetings:

How do I populate common fields on a form when the information is not directly based to the form.

An example - I have a form called frmLivestock which will have an OwnerNo Combo Box (looking at a table of tblOwners). How can I get the form to show the owner's name, address, etc. from that OwnerNo field?

Thanks for the help.
 
If the Combo Box is based on the Orders table, do you have multiple fields showing when the drop-down opens. If so, on the After Update property of the ComboBox, use this type of VBA code...

[OwnerName].Value = [Owner].Column(0)

where OwnerName is one of the fields you want filled-in, Owner is the name of the ComboBox and 0 'zero' represents the data shown in the first column of the drop-down, then 1, 2, 3, etc left to right for drop-down data.

HTH jt
 
Thanks - that helps on some - but what about...

What if you are populating fields from several tables.

An example would be:

frmShowWeight would have fields called Exhibitor, Specie, Breed, BegDate, BegWeight, and Gender with all of those inputs coming from seperate tables.

My ComboBox will select a TagNo from tblLivestock that has information relating back to all these other tables.

Any ideas would be helpful.

Thanks Again
 
In that case you may wish to investigate the DLOOKUP () function (see Access HELP). As long as your database is not overly large (many thousands of records) the DLOOKUP is ok to use.

Another alternative not knowing exactly how your data is layed-out might be to use a multi-table query as the feed to the Combo Box. HTH jt
 

Users who are viewing this thread

Back
Top Bottom