Hi ther thanx for looking, i need help with a SQL syntax question. I'm not very good with SQL and have never used in within VBA.
I have 2 list boxes that provide the criteria for the SQL
They work correctly and return the correct values, they are both string data types:
manufactName as string
categoryName as string
' set values of both
manufactName = Me.lstManufacturer.Value
categoryName = Me.lstStockCat.Value
'my sql statement
DoCmd.RunSQL "SELECT tblStock.[fkManufacturer ID], tblStock.[fkStockCategory ID], tblStock.[Stock ID], tblStock.[Stock Description], tblStock.[Stock Boundary Level], tblStock.[Stock Level] FROM tblStock WHERE (((tblStock.[fkManufacturer ID])= manufactName ) AND ((tblStock.[fkStockCategory ID])= categoryName));"
ERROR 2343, statement requires an SQL statement
Any help is appreciated, thanx very much in advance.
I have 2 list boxes that provide the criteria for the SQL
They work correctly and return the correct values, they are both string data types:
manufactName as string
categoryName as string
' set values of both
manufactName = Me.lstManufacturer.Value
categoryName = Me.lstStockCat.Value
'my sql statement
DoCmd.RunSQL "SELECT tblStock.[fkManufacturer ID], tblStock.[fkStockCategory ID], tblStock.[Stock ID], tblStock.[Stock Description], tblStock.[Stock Boundary Level], tblStock.[Stock Level] FROM tblStock WHERE (((tblStock.[fkManufacturer ID])= manufactName ) AND ((tblStock.[fkStockCategory ID])= categoryName));"
ERROR 2343, statement requires an SQL statement
Any help is appreciated, thanx very much in advance.