Link to home
Start Free TrialLog in
Avatar of lheroux
lheroux

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lheroux
lheroux

ASKER

Desktop application. I will fix field names and try the coding. Thank you.
Avatar of lheroux

ASKER

"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?
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.
Avatar of lheroux

ASKER

Finally accomplished what I wanted to do. Thank you so much for your assistance. Have a great w/e!