morpheusdreams
MIS
I run the following from a command button:
And get an error of "A runSQL action requires an argument consisting of an SQL statement."
When i use the immediate window to get the string and place it into the sql query window and run it it works fine.
what am i doing wrong?
Code:
Dim strSQL As String
strSQL = "SELECT tbl_Agents.[AgentName], tbl_Agents.[Aspect_No] " & _
"FROM tbl_Agents " & _
"WHERE tbl_Agents.[TM_ID] = " & Form_frm_TMs.dd_TMID.Value & ";"
DoCmd.RunSQL (strSQL)
And get an error of "A runSQL action requires an argument consisting of an SQL statement."
When i use the immediate window to get the string and place it into the sql query window and run it it works fine.
Code:
?strSQL
SELECT tbl_Agents.[AgentName], tbl_Agents.[Aspect_No] FROM tbl_Agents WHERE tbl_Agents.[TM_ID] = '2';
what am i doing wrong?