I am using MS Access 2013 and I have a table where one of the fields is a dropdown that looks up values from another table. I am passing IDs to a SQL statement using a vba function and SQL IN() clause. It works with one value, when more than one value is passed it returns no records or a data type mismatch.
DIM varIDs AS String
VBA Function
getIDs(varIDs)
SQL Statement
SELECT ID, Name FROM Table
WHERE Table.ID IN (getIDs())
When varIDs = "26" it works When varIDs = "26, 27" it doesn't return anything or returns a data type mismatch
Been searching for an answers for 2 days and can't figure why its not working with multiple IDs being passed. Any help is appreciated
"26,27"(comma included.