Assign the output of a select to a variable?
I am unable to find a way to assign the results of an SQL statement to a variable. I know how to assign the SQL statement to a variable but again no luck assigning the results. I have the need to assign the primary key of a table, which is an auto number data type) therefore a numeric value. My select is very basic for I am just looking for the primary key where two options are met.
So instead of returning the select to the variable I need to return the numeric value which meets the where clause above.
Can you help me?
Thanks
Birky
I am unable to find a way to assign the results of an SQL statement to a variable. I know how to assign the SQL statement to a variable but again no luck assigning the results. I have the need to assign the primary key of a table, which is an auto number data type) therefore a numeric value. My select is very basic for I am just looking for the primary key where two options are met.
Code:
"SELECT [ID]" & _ "FROM [Custom_Code]" & _ "WHERE ([Project_Name]=' & Me!Project_Name" & _"') AND ([element_Name]=' & Me!Element_Name & ') )"
Can you help me?
Thanks
Birky
Comment