Is it possible to use a variable as the criteria within a dcount statement?
I've established a variable named strTestSring.
I can't get this statement to work, DCount("*", "Holiday_Matrix", strTestString = (-1))
Thanks in advance!
Is it possible to use a variable as the criteria within a dcount statement?
I've established a variable named strTestSring.
I can't get this statement to work, DCount("*", "Holiday_Matrix", strTestString = (-1))
Thanks in advance!
I am assuming that strTestString is a variable that holds a field name in your table (or else it doesn't really make sense).
If that is the case, this should work:
(remember, everything enclosed in quotes is interpreted as literal text, so your variables need to be outside of that)Code:DCount("*", "Holiday_Matrix", myTestString & "=(-1)")
Thank you.