R
rocketD
Hi All,
I'm trying to generate a report based on a query that receives its
input from a form. Specifically, I need to be able to select all
specimens collected of a particular genus/species combo, specified by a
user, during a date range specified by the user. The form itself is
unbound. The genus and species fields are separate (one genus to many
species)and bound to lookup tables, so that I can limit the species to
the genus selected. When all 4 fields in the form are filled, the query
works fine. However, leave a field blank, and no records are returned.
My two goals:
1) I want the user to be able to specify a genus and leave species
blank/provide a wildcard so that ALL specimens with that selected genus
are returned (not just a particular species);
2) I want the user to be able to leave the dates blank/provide a
wildcard so that he can get a report of all specimens of a particular
genus or genus/species combo ever entered.
I have this statement in the query under the genus field:
Like [forms]![fm_reportGenus]![genus]
and under the species field:
Like [forms]![fm_reportGenus]![species]
and finally, I have this statement in the query under the date field:
Between [forms]![fm_reportGenus]![StartDate] And
[forms]![fm_reportGenus]![EndDate]
I have a separate form for a report of just a date range, but I'd like
to be able to query based on date or on genus/species, or just genus.
Can anyone tell me how to make this report work if the species or date
range fields are blank?
Thanks!
Dara
I'm trying to generate a report based on a query that receives its
input from a form. Specifically, I need to be able to select all
specimens collected of a particular genus/species combo, specified by a
user, during a date range specified by the user. The form itself is
unbound. The genus and species fields are separate (one genus to many
species)and bound to lookup tables, so that I can limit the species to
the genus selected. When all 4 fields in the form are filled, the query
works fine. However, leave a field blank, and no records are returned.
My two goals:
1) I want the user to be able to specify a genus and leave species
blank/provide a wildcard so that ALL specimens with that selected genus
are returned (not just a particular species);
2) I want the user to be able to leave the dates blank/provide a
wildcard so that he can get a report of all specimens of a particular
genus or genus/species combo ever entered.
I have this statement in the query under the genus field:
Like [forms]![fm_reportGenus]![genus]
and under the species field:
Like [forms]![fm_reportGenus]![species]
and finally, I have this statement in the query under the date field:
Between [forms]![fm_reportGenus]![StartDate] And
[forms]![fm_reportGenus]![EndDate]
I have a separate form for a report of just a date range, but I'd like
to be able to query based on date or on genus/species, or just genus.
Can anyone tell me how to make this report work if the species or date
range fields are blank?
Thanks!
Dara