How to update a field on a form with selection in a combo box

  • Thread starter Thread starter wesley.allen
  • Start date Start date
W

wesley.allen

FYI: I am somewhat new to Access, so I try to do things simple using
macros rather than SQL.

That being said, I am trying to setup a form that has a combo box where
I can make a selection and have the form run that selection of a name
and have the form pass that selection to a table and if possible show
the data on the form.

Detail.

I have a form setup where I am inputing results from a survey. The
table that holds the info uses email addresses to identify the
respondants. I have another table with the respondants names and
corresponding email addresses. When I input the responses, I want to
use a combo box to select the respondant (because I don't know their
email addresses without looking in the table that has them) and have
the form automatically add their email address to the table with their
responses based on the name I select.

I know this is a bit confusing. Sorry. Any help is appreciated.

Thanks.
 
I think I understand your question. I'll take a stab at it. It sounds like
you have a form that you are entering suvey reponses in. The form record
source is a table that holds the survey responses. There is a field for email
and you want to select the name for that field instead of email and then
continue on to the other fields from the survey. If my interpretation is
correct, read on.

Place a drop-down box on the form and set the properties as follows:
Row Source: Create a query from the table that holds the names and email
addresses. Put the two fields email and name on the form in that order (sort
by name).
Bound Column: 1
Column Count: 2
Column Widths: 0";1"
Control Source: email field from the table

This will automatically enter the email address into the table when you
select the name.
 
Thanks for the help. I am close.

However, when I did this, it always chooses the first name on the list,
no matter which name I choose. Any idea what would cause this?

Thanks again.
 
I'm not sure what would cause that. Do you have any other code or event
procedures attached to the form? I would suggest putting an after update
event procedure on the drop-down showing the value (for debuging only)
Msgbox(drpName.Value)
Msgbox([email_field].Value)
 
Back
Top