Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running query in event procedure in Access?

Tags:

sql

vba

ms-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

like image 517
jmasterx Avatar asked Oct 08 '22 04:10

jmasterx


1 Answers

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

like image 178
Igor Turman Avatar answered Oct 12 '22 21:10

Igor Turman