Updating multiple fields from a single combo box

G

Guest

I am using a form to add items to a table. In order to update three fields I
use a combo box to specify what value is needed for each field. These values
are obtained from another table. What I am having trouble with is I would
like to use one combo box search to populate all three fields. The values are
returned during first use of combo box and I am sure there is a way to load
all three fields at one time vs having user enter data in other two items.
Example: DonorTable being updated needs 'Agency' 'Agenct Type' and 'Agency
ID'.
AgencyTable has this information.
Add Form uses a combo box to return list of Agencies from
the Agency
Table which in turn updates the DonorTable AgencyName. At
this time I
would like to plug Agency Type and ID in the DonorTable
bypassing user
input.
I know this breaks good database design but the Agency table changes and user
needs to keep track of historical data which forces me to keep information
in donorTable.

Thanks for any help.
 
D

Duane Hookom

Since you "know this breaks good database design" I will spare the
lecture...

You can use the update event of the combo box to set values of other text
boxes.
Me.txtAgencyName = Me.cboAgencies.Column(1)
Me.txtAgencyType = Me.cboAgencies.Column(2)

You will need to substitute your control names and column numbers. Columns
are numbered beginning with 0.
 
G

Guest

Thanks Duane,works like a charm. I am working on my users to get them to
better understand the design of a database.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top