Form recordset (1 Viewer)

jrjr

A work in progress
Local time
Yesterday, 23:25
Joined
Jul 23, 2004
Messages
291
Hi all

I would like to filter my form - AdminForm with a combo box. If the user selects one of the choices.... Open, Completed, Hold then the records would be sorted by that criteria. There is a bound combo on the form now for the user to choose the state that the record is in and it coincides with the sort terms. I also have an unbound combo set up to use for the sort - ComboStatusFilter. I was thinking that an SQL statement for the form properties should work but am not sure how to write it. Is this the right way to go about it? Any help would be appreciated! I have been reading and searching for days but as yet not found what I am looking for, or cant recognize it at least. LOL

Thanks!
 

jrjr

A work in progress
Local time
Yesterday, 23:25
Joined
Jul 23, 2004
Messages
291
Ok I got this going with a query. I used this as the criteria in the status field which holds the same criteria as my combo:

[Forms]![AdminForm]![StatusFilter]
Where StatusFilter is my unbound combo box.
That turned out easy enough!

Now, If I want to show all of the records and not just the ones selected by the query criteria, how do I remove the criteria?
 
C

chevin

Guest
Probably what you will want to do is change your query criteria to a conditional statement.

On your form, add a 4th value "All" to your unbound combo box.

Make your query criteria
Code:
Iif([Forms]![AdminForm]![StatusFilter]="All", ,[Forms]![AdminForm]![StatusFilter])

Think that should do it.

--Kevin
 

Users who are viewing this thread

Top Bottom