Hello.
I'm trying to design a search form whereby a user can search through all the contacts in our customer database using a number of criteria. The idea is that the user can enter partial data, like surname (or part of surname), organisation name etc. I'd also like to include a checkbox to search for whether the contact is active or not.
On clicking a button, another form is opened that should display all the contacts filtered by the appropriate criteria. All well and good except that the "Active" checkbox is not returning the expected results - if "Active" is ticked, I get 570 contacts returned (all the contacts in the database). If unticked, I get 538 back. I've tested the syntax of my criterion in a test query and it returns the correct numbers. This is it:
[Forms]![frmContactSearch].[form]![chkContactActive].[value]
So as you can see, it's referencing a form called "frmContactSearch" and filtering based on the status of the checkbox "chkContactActive". To reiterate, this works fine in a very simple query, but falls over in the more complex one. I can't share my data for security reasons, but is there something I should be looking for in the way I've constructed the query underlying my form that might cause this sort of behaviour?
Many thanks,
Pete
P.S. sorry posted early by accident, before I'd finished writing.
I'm trying to design a search form whereby a user can search through all the contacts in our customer database using a number of criteria. The idea is that the user can enter partial data, like surname (or part of surname), organisation name etc. I'd also like to include a checkbox to search for whether the contact is active or not.
On clicking a button, another form is opened that should display all the contacts filtered by the appropriate criteria. All well and good except that the "Active" checkbox is not returning the expected results - if "Active" is ticked, I get 570 contacts returned (all the contacts in the database). If unticked, I get 538 back. I've tested the syntax of my criterion in a test query and it returns the correct numbers. This is it:
[Forms]![frmContactSearch].[form]![chkContactActive].[value]
So as you can see, it's referencing a form called "frmContactSearch" and filtering based on the status of the checkbox "chkContactActive". To reiterate, this works fine in a very simple query, but falls over in the more complex one. I can't share my data for security reasons, but is there something I should be looking for in the way I've constructed the query underlying my form that might cause this sort of behaviour?
Many thanks,
Pete
P.S. sorry posted early by accident, before I'd finished writing.
Last edited: