Display all records if no filtering criteria is provided...

Fuse3k

Registered User.
Local time
Today, 00:10
Joined
Oct 24, 2007
Messages
74
Hello all,

I've run into a little snag and I'm hoping to reach out for some assistance.

I've created a form that has a drop down box. This dropdown box is populated with a list of values taken from a database.

I've created a query and built an expression that filters the query records by the value of said drop down box.

My issue here is if no value is selected in the drop down box, the query produces no records. I would like the query to display all records if the user did not select a value from the drop down.

Although I'm a beginner by any stretch of the imagination, I did manage to make a conditional in VBA to apply a wildcard (*) if nothing was chosen in the drop down, but that didnt work.

I'm at a loss. Can anyone offer a solution?

TIA,

Fuse
 
You can try for Strings:

"[Fieldname] like '" & .[Combibox] & "*" & "'"

And Numeric fields:

"[Fieldname] = " & .[Combibox] & ""

Simon
 

Users who are viewing this thread

Back
Top Bottom