data entry form with associated table drop down

S

susanhull

I'm creating a data entry form using a query: AgencyID from my main
table and AgencyID (primary) and AgencyName from the related Agency
table. I want the user to select from a drop down list of agency names
from the Agency table. When the record is added to the main table, how
do I update the AgencyID on the main table, instead of the AgencyName
on the Agency table?

Your suggestions how to accomplish this would be appreciated. I'm
relatively new to Access.
 
A

Al Campagna

Susan,
Create a two column combobox (ex. cboAgencyID) with the following properties.
ControlSource = AgencyID (from the table your are updating)
Col1 Col2
-------- --------
AgencyID AgencyName (asc)

NoOfColumns = 2
ColWidths = 0";1.5"
ListWidth = 1.5"

This allows the user to select an entry by AgencyName, and dsiplays that AgencyName in
the combo for the user...
BUT... it really stores the AgencyID in the AgencyID field of your table, which is really
what you want to "capture."
To check this, go to the Table of the form table itself, and you'll see the AgencyID
stored in the AgencyID field.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
S

susanhull

Susan,
Create a two column combobox (ex. cboAgencyID) with the following properties.
ControlSource = AgencyID (from the table your are updating)
Col1 Col2
-------- --------
AgencyID AgencyName (asc)

NoOfColumns = 2
ColWidths = 0";1.5"
ListWidth = 1.5"

This allows the user to select an entry by AgencyName, and dsiplays that AgencyName in
the combo for the user...
BUT... it really stores the AgencyID in the AgencyID field of your table, which is really
what you want to "capture."
To check this, go to the Table of the form table itself, and you'll see the AgencyID
stored in the AgencyID field.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVPhttp://home.comcast.net/~cccsolutions







- Show quoted text -

Your suggestion worked beautifully! Thank you for your time.
 

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

Top