Quote:
Originally Posted by waltvw
It works but I just discovered that either Date or CustID is not taken into consideration in the evaluation, i.e. only one condition can actually be used in FindFirst as opposed to "Where" clause in SQL statement that can use multiple AND's & OR's. This is because my next statement, If .NoMatch evaluates to True even if there are records in the table that has a combination of CustID and Date which have been evaluated by .FindFirst statement. If that's the case, I'm still OK, 'cause before I got your response on how to fix the syntax in question I had created some logic in the loop to get around the issue.
Thanks again!
To the best of my knowledge, the FindFirst method can have compound conditions. If .NoMatch is not working, it might be because the wrong syntax is being used for the data type.
For example, the syntax of your FindFirst statement presents CustID as a text data type:
-
FindFirst "[CustID] = ' " & rstOtherTBL!CustID & " ' " _
-
& " And [Date] = #" & StartDate & "# "
-
If CustID is a numeric data type, the syntax should have been as follows:
-
FindFirst "[CustID] = " & rstOtherTBL!CustID _
-
& " And [Date] = #" & StartDate & "# "
-
If syntax of the CustID is not the problem, let me know and I will look into the FindFirst method. .