herbivorous
Technical User
I am building an app that tracks, among other things, contacts with members of the table People. I am working on a master filtering page, and want to be able to slap on a filter so that only those with a certain contact code come up.
My first attempt has been to build a DLookup into the SQL statement, but so far it has failed:
(DCount('[Contact ID]','table![Contact Log]','ID = " & Chr(34) & " & ID & " & Chr(34) & " And [Contact Code] = " & Chr(39) & Me!CCode & Chr(39) & " > 0 )"
Gives me an SQL statement like
(DCount('[Contact ID]','table![Contact Log]','ID = " & ID & " And [Contact Code] = 'Book Tour') > 0 )
Generating the following complaint: Syntax error (missing operator)
I could potentially approach it differently -- using a loop through the Contact Log table to generate list of IDs for an ID IN (1,4,9,23) statement.
Or perhaps there is another option. I don't want to relate the table, which would be the easiest way to handle this, I guess. But there are reasons against that I don't know how to surmount.
Thanks!
My first attempt has been to build a DLookup into the SQL statement, but so far it has failed:
(DCount('[Contact ID]','table![Contact Log]','ID = " & Chr(34) & " & ID & " & Chr(34) & " And [Contact Code] = " & Chr(39) & Me!CCode & Chr(39) & " > 0 )"
Gives me an SQL statement like
(DCount('[Contact ID]','table![Contact Log]','ID = " & ID & " And [Contact Code] = 'Book Tour') > 0 )
Generating the following complaint: Syntax error (missing operator)
I could potentially approach it differently -- using a loop through the Contact Log table to generate list of IDs for an ID IN (1,4,9,23) statement.
Or perhaps there is another option. I don't want to relate the table, which would be the easiest way to handle this, I guess. But there are reasons against that I don't know how to surmount.
Thanks!