How do I create a combo box that uses 2 fields from either a table or query?

In Access 365 I would like to create a combo box of Sponsors of new club .applicants. The box should contain the name and email address of the sponsor sorted alphabetically by name. The label would be "Sponsor."  The field names are: "Name" and "Email Address." The table name is "tblSponsors." The query is "qrySponsors" Can this be done? If so, how? I haven't been able to figure out the coding as I have not done coding in about 7 years. Any help would be greatly appreciated.
lherouxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
When you say "Access 365", are you referring to a web application, or a desktop application?

To show values in a combo, you set the combo's RowSource to the query you would like to use, and you then set the attributes of the combo for the number of Columns and such. For example, to show two columns in the dropdown of the query, I might have the following attributes:

RowSource: SELECT Name, [Email Address] FROM tblSponsors"
ColumnCount: 2
ColumnWidths: 1;1

This would show both the Name and Email Address column.

I'd also caution you against creating columns with irregular characters, like a space. Instead of "Email Address", you should use something like "EmailAddress" or "Email_Address".
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lherouxAuthor Commented:
Desktop application. I will fix field names and try the coding. Thank you.
0
lherouxAuthor Commented:
"Syntax error in query. Incomplete query clause."

SELECT Name, [EmailAddress] FROM "tblSponsors" ColumnCount: 2; ColumnWidths: 1;1

I changed field names per your suggestion. What am I missing here? Punctuation?
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Your RowSource should be:

SELECT Name, [EmailAddress] FROM tblSponsors

You don't need quotes around the table name.

The other two items are Attributes/Properties of the Combo. Open the form in Design view, select the Combo, and look at the Properties sheet. You'll find the ColumnCount and ColumnWidths there.
0
lherouxAuthor Commented:
Finally accomplished what I wanted to do. Thank you so much for your assistance. Have a great w/e!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.