invalid syntax in Dlook up query with multiple criteria

MilaK

Registered User.
Local time
Today, 15:15
Joined
Feb 9, 2015
Messages
285
Please help to figure out the proper use of quotes in the following Dlook-up query:

MetDNA: DLookUp("[tbl_Variant_qry].[gene]","[tbl_Variant_qry]","[tbl_Variant_qry].[sample_id] = '" & [sample_id] & "' And InStr([tbl_Variant_qry].[gene],"MET")>0 And InStr([tbl_Variant_qry].[exon],"14")>0")

Thanks
 
Is sample_id a number type field? If it is then remove the apostrophe delimiters for [sample_id] parameter.

Use apostrophes in place of the inner quote marks to delimit the literal strings. Again, if [exon] is a number type field, don't use delimiters. Date/time fields would use # delimiter for parameters.

MetDNA: DLookUp("[gene]", "[tbl_Variant_qry]", "[sample_id] = '" & [sample_id] & "' And InStr([gene],'MET')>0 And InStr([exon],'14')>0")
 

Users who are viewing this thread

Back
Top Bottom