Return all records by default when using a combo box to select a .

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using Access 2003. I have created a form with 3 combo boxes so a user can
filter a report by these 3 fields. But I want to return all the records by
default if the user clicks on the "run report" button. How can I do this?
Also is there a way for the combo boxes to have the word "ALL" in them so the
user knows that this is the default.

Thanks!
 
Presumably you are constructing filter clauses to pass to the report? If so
then if user has not seleceted in combo and combo has no default value its
value will be Null. So when constructing your filter clause you can do
something like...

If not IsNull(combo_field) then
filter_string = "column_name = " & combo_field
else
filter_string = ""
end if

Madhouse
 
Sorry I should have expressed the problem more clearly. I am not using a
"filter clause" in fact I copied exactly the directions found in the
following URL:
http://office.microsoft.com/en-us/assistance/HA011170771033.aspx So, I have a
query that is filtered in the criteria field (3 of them) by the form I
created. The criteria has the following format: [FORM]![MYFORM]![FIELD1] As
you mentioned since I did not set default values the combo boxes all are
emply when the form is run. The query associated with each combo box runs a
SELECT DISTINCT on the column that is used for the filter. So you will have
let's say five choses to pick from and this will be the filter. Therefore,
back to the question how do I get it to SELECT * from that column by default
and if possible say "ALL" in the combo box.
 
Back
Top