I am trying to run an SQL statement from vb but keep getting the error 2342 - A RunSQL action requires an argument consisting of an SQL statement. I stored the SQL in a variable and tried using DoCmd.RunSQL. The code...
Any ideas what's wrong? Any help you provide is much appreciated. Thanks.
Chew
Code:
Dim mySQL As String
mySQL = "Select [LKP_tblRouteCodes].[Route Number]"
mySQL = mySQL + "from LKP_tblRouteCodes where ((([Route Code]) = 'A'))"
If cboRouteCodes = "A" Then
DoCmd.RunSQL mySQL
Any ideas what's wrong? Any help you provide is much appreciated. Thanks.
Chew