AccessLuke
New member
- Local time
- Today, 07:35
- Joined
- May 29, 2014
- Messages
- 2
Could somebody help me please?
I have a database for case files, with a search form containing various text boxes that lets you enter criteria for the search so that when you click the search button, the results are displayed in a report. However I would like to add a tick box on the search form, so that when ticked it allows cases of all statuses (i.e. include case files that have their “Status” field set to the value “Closed”) and when not ticked I want it to include all records that are not “Closed”.
My Form is called “SearchForm”
My tick box is named “IncludeClosed”.
[Status] is a text field in my Table that has values such as “Open”, “Pending” and “Closed”.
I have used the following code:
IIf([Forms]![SearchForm]![IncludeClosed]=-1,[Status],[Status]<>"Closed")
Where am I going wrong?
Many thanks and kind regards
Luke
I have a database for case files, with a search form containing various text boxes that lets you enter criteria for the search so that when you click the search button, the results are displayed in a report. However I would like to add a tick box on the search form, so that when ticked it allows cases of all statuses (i.e. include case files that have their “Status” field set to the value “Closed”) and when not ticked I want it to include all records that are not “Closed”.
My Form is called “SearchForm”
My tick box is named “IncludeClosed”.
[Status] is a text field in my Table that has values such as “Open”, “Pending” and “Closed”.
I have used the following code:
IIf([Forms]![SearchForm]![IncludeClosed]=-1,[Status],[Status]<>"Closed")
Where am I going wrong?
Many thanks and kind regards
Luke