0

I am trying to pass a whole recordset into a query. I have made a form, with a listbox that is linked to a table that has 2 columns: Country and CountryID.
When I select the Country on the form, i need the Country and the CountryId to be passed to a query.
Could someone help me on How I can set a variable in VBA that would take it's value from the corresponding recordset when I select the Country in the Listbox.

Example:
Country CountryID
Argentina AG
Brazil BZ
United State US

Given the name for these 2 variables is list.country and list.countryId, how do I make vba.countryId = list.countryId for the corresponding vba.country = list.country?

2
Contributors
1
Reply
3
Views
8 Years
Discussion Span
Last Post by Jishnu
0

When I select the Country on the form, i need the Country and the CountryId to be passed to a query.

I understand that when the user selects the country, he/she should get the country id. Is it so? then why do you want to pass the entire record set? Why do you want the country id to be passed in a query? To fetch any other property?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.