Hello All,
I have the following code on a form used to search a table. My goal is that if someone enters any information into the field, it will search for any entry's that contains the entered string. I also want it so that if anyone leaves the field blank, it will return every record.
The search part works great. My problem is that any record that has a null value for that field won't get returned.
If IsNull(Me![MapNameNumber]) Then
Criteria = [MapName/Number] Like ""*"""
Else: Criteria = [MapName/Number] Like ""*" &
Me.MapNameNumber & "*"""
End If
I've tried including something like:
Criteria = [MapName/Number] Like "("*" OR null)""
and just get compile errors. I'm not even sure if I'm heading down the right path or not. If anyone has any insight or quick ideas, I would appreciate it.
Thanks again,
jodym43
I have the following code on a form used to search a table. My goal is that if someone enters any information into the field, it will search for any entry's that contains the entered string. I also want it so that if anyone leaves the field blank, it will return every record.
The search part works great. My problem is that any record that has a null value for that field won't get returned.
If IsNull(Me![MapNameNumber]) Then
Criteria = [MapName/Number] Like ""*"""
Else: Criteria = [MapName/Number] Like ""*" &
Me.MapNameNumber & "*"""
End If
I've tried including something like:
Criteria = [MapName/Number] Like "("*" OR null)""
and just get compile errors. I'm not even sure if I'm heading down the right path or not. If anyone has any insight or quick ideas, I would appreciate it.
Thanks again,
jodym43