I have a form with list control named lstCustomer
. I am passing rowsource
method a string as shown below
me.lstCustomer.RowSource = lstSQL
The lstSQL is being specified before assigning to rowSource method.
lstSQL = "SELECT FullName, City & " - " & Region AS Location FROM tblContact ORDER BY FullName;"
This is produicing an error Type Mismatch
When I am not using concatenated column, I am not getting this error. I tried the below code (this does not produces the error)
lstSQL = "SELECT FullName, City, Region FROM tblContact ORDER BY FullName;"
I want to show city and region in a single column. Please point out my mistake. Thanks in advance.
Please use single quotes '
instead of "
in the query:
SELECT FullName, City & ' - ' & Region AS Location
FROM tblContact ORDER BY FullName;