I have a search form to find insurance policies in my database. I'm using the Allen Browne method with multiple filter criteria on a continuous form, and for the most part, it's working great. However, I can't get the filter to work for searching by the Account Name. I'm thinking the problem is most likely due to that field's control source being a DLookup, instead being tied directly to the table. The reason for this is that both the Account and Insurance Company's IDs are present in the continuous form, and they both are Entity IDs (EntID) that come from the same table. So when I originally created this form, instead of pulling the Account Name from that EntID, the field was populating with the Insurance Company's name based on that EntID field, so I wrote a DLookup to make it pull from the correct EntID.
So now when I try to use this code to compare the Account Name to the filter field, I get no results:
Code:
If Not IsNull(Me.ctlActName) Then
strWhere = strWhere & "([EntPrimName] Like ""*" & Me.ctlActName & "*"") AND "
End If
I've experimented with writing a DLookup into VBA instead of as the control source and a number of other tweaks, but can't get anything to work. How would I need to manipulate this code in order for it to read the results of the DLookup?