jmasterx
jmasterx

Reputation: 54183

Running query in event procedure in Access?

I have a combo box in my form with Member IDs, when I select a member ID, I want my txtLastName text box to be set to the member's name. I know what to write for the SQL query, but I don't know how to run that query and obtain the resulting name and put it into a String.

How could this be done?

Thanks

Upvotes: 5

Views: 1551

Answers (1)

Igor Turman
Igor Turman

Reputation: 2205

Access provides "out-of-the-box" solution for this without need for additional query. The idea is to use multiple columns from the combobox like this (in code):

Me.ComboBox.Column(N)

Check this out:

http://www.techrepublic.com/blog/msoffice/automatically-fill-in-access-text-boxes-based-on-a-combo-box-selection/1330

Upvotes: 4

Related Questions