I have a sql statement that returns 1 field. I need to put that field into a variable. I know I can open a recordset to get the value. Thie sql statement runs several times during the program execution.
Is there a way to directly put the result of the sql statement into a variable without opening a recordset?
Here is the code:
rstSQLCurrBom = "SELECT Max([ItemSpecId]) AS CurrentBOM " & _
"FROM dbo_ItemSpecs " & _
"WHERE (((dbo_ItemSpecs.ItemNo)='" & rstChairs!Item & "'));"
CurrentBOM is what I need to put in a variable.
Thanks in advance for your help.
Razor1
Is there a way to directly put the result of the sql statement into a variable without opening a recordset?
Here is the code:
rstSQLCurrBom = "SELECT Max([ItemSpecId]) AS CurrentBOM " & _
"FROM dbo_ItemSpecs " & _
"WHERE (((dbo_ItemSpecs.ItemNo)='" & rstChairs!Item & "'));"
CurrentBOM is what I need to put in a variable.
Thanks in advance for your help.
Razor1