I'm having trouble using a string variable as a condition in my If...Then statement. I have a concatenated variable which refers to an open recordset:
strAddNewCriteria = "rstDeliverable!" & strActFieldName & " <> 0 And rstDeliverable!booRequired = True And " & strClassCriteria
I try to execute an If...Then loop using strAddNewCriteria as the If criteria:
If Eval(strAddNewCriteria) Then
The application tells me that Access cannot find the rstDeliverable recordset. But, when I use the actual string (rather than the variable), the If...Then loop functions properly.
Does anyone have any suggestions?
Thank you very much.
strAddNewCriteria = "rstDeliverable!" & strActFieldName & " <> 0 And rstDeliverable!booRequired = True And " & strClassCriteria
I try to execute an If...Then loop using strAddNewCriteria as the If criteria:
If Eval(strAddNewCriteria) Then
The application tells me that Access cannot find the rstDeliverable recordset. But, when I use the actual string (rather than the variable), the If...Then loop functions properly.
Does anyone have any suggestions?
Thank you very much.