Filter Assistance

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

Guest

I need help! In more ways than one, but especially with a formula/filter. I
have a form (Age Selection Form) with a listbox that has several different
age ranges to select from (ie; 0-5, 6-12, 13-17, 18+). When you double click
on one of the selection I need it to run a report that filters students by
the age range selected. I am able to open the report but the filter I have
created or attempted to create keeps giving me an error stating that I am
“missing an operator†and I can’t seem to find out where…Below I have listed
what I have come up with so far. If anyone could take a look at it and
possibly show me where I have gone wrong I would be forever grateful.

Here is what I have so far:

Age=IIF(([Forms]![Age Selection Form]![Age Selection]="0-5"), >="0" And <="5")

I may be completely off but I was just trying to test with one of the age
ranges. I can add the rest once I get the basic part down.

Again, any assistance would be greatly appreciated. I thank you in advance
for your time and effort.
 
I suggest you divide your list box in 2 columns, initial_age and final_age to
create a range,

then your filter, if sending the filter from your form, will be like

strcriteria="[Age] between " & me.MyListBox.column(0) & " and " &
me.MyListBox.column(1)

docmd.openreport "MyReport",openoption,strcriteria
 
Hi jl5000,
I have been attempting to run as you described to no avail. What if I run
this from a macro?
--
Randy Street
Rancho Cucamonga, CA


jl5000 said:
I suggest you divide your list box in 2 columns, initial_age and final_age to
create a range,

then your filter, if sending the filter from your form, will be like

strcriteria="[Age] between " & me.MyListBox.column(0) & " and " &
me.MyListBox.column(1)

docmd.openreport "MyReport",openoption,strcriteria
--
jl5000
<a href="http://www.joshdev.com"></a>


Randy said:
I need help! In more ways than one, but especially with a formula/filter. I
have a form (Age Selection Form) with a listbox that has several different
age ranges to select from (ie; 0-5, 6-12, 13-17, 18+). When you double click
on one of the selection I need it to run a report that filters students by
the age range selected. I am able to open the report but the filter I have
created or attempted to create keeps giving me an error stating that I am
“missing an operator†and I can’t seem to find out where…Below I have listed
what I have come up with so far. If anyone could take a look at it and
possibly show me where I have gone wrong I would be forever grateful.

Here is what I have so far:

Age=IIF(([Forms]![Age Selection Form]![Age Selection]="0-5"), >="0" And <="5")

I may be completely off but I was just trying to test with one of the age
ranges. I can add the rest once I get the basic part down.

Again, any assistance would be greatly appreciated. I thank you in advance
for your time and effort.
 
Randy,
It should work on a macro, just make sure to reference your criteia with
whole forms![My_Form]!... syntax
--
jl5000
<a href="http://www.joshdev.com"></a>


Randy said:
Hi jl5000,
I have been attempting to run as you described to no avail. What if I run
this from a macro?
--
Randy Street
Rancho Cucamonga, CA


jl5000 said:
I suggest you divide your list box in 2 columns, initial_age and final_age to
create a range,

then your filter, if sending the filter from your form, will be like

strcriteria="[Age] between " & me.MyListBox.column(0) & " and " &
me.MyListBox.column(1)

docmd.openreport "MyReport",openoption,strcriteria
--
jl5000
<a href="http://www.joshdev.com"></a>


Randy said:
I need help! In more ways than one, but especially with a formula/filter. I
have a form (Age Selection Form) with a listbox that has several different
age ranges to select from (ie; 0-5, 6-12, 13-17, 18+). When you double click
on one of the selection I need it to run a report that filters students by
the age range selected. I am able to open the report but the filter I have
created or attempted to create keeps giving me an error stating that I am
“missing an operator†and I can’t seem to find out where…Below I have listed
what I have come up with so far. If anyone could take a look at it and
possibly show me where I have gone wrong I would be forever grateful.

Here is what I have so far:

Age=IIF(([Forms]![Age Selection Form]![Age Selection]="0-5"), >="0" And <="5")

I may be completely off but I was just trying to test with one of the age
ranges. I can add the rest once I get the basic part down.

Again, any assistance would be greatly appreciated. I thank you in advance
for your time and effort.
 
Ok...Please excuse my ignorance....Maybe I am puting these in the wrong
places. You stated that if I send the filter from my form to try the filter
you suggested...Where exactly in the form should this be placed? As well as
the "docmd" function? When I "double click" on the ranges within my selection
list it want to look for a macro. When I input the filter into the macro it
still returns an error (missing operator)....
--
Randy Street
Rancho Cucamonga, CA


jl5000 said:
Randy,
It should work on a macro, just make sure to reference your criteia with
whole forms![My_Form]!... syntax
--
jl5000
<a href="http://www.joshdev.com"></a>


Randy said:
Hi jl5000,
I have been attempting to run as you described to no avail. What if I run
this from a macro?
--
Randy Street
Rancho Cucamonga, CA


jl5000 said:
I suggest you divide your list box in 2 columns, initial_age and final_age to
create a range,

then your filter, if sending the filter from your form, will be like

strcriteria="[Age] between " & me.MyListBox.column(0) & " and " &
me.MyListBox.column(1)

docmd.openreport "MyReport",openoption,strcriteria
--
jl5000
<a href="http://www.joshdev.com"></a>


:

I need help! In more ways than one, but especially with a formula/filter. I
have a form (Age Selection Form) with a listbox that has several different
age ranges to select from (ie; 0-5, 6-12, 13-17, 18+). When you double click
on one of the selection I need it to run a report that filters students by
the age range selected. I am able to open the report but the filter I have
created or attempted to create keeps giving me an error stating that I am
“missing an operator†and I can’t seem to find out where…Below I have listed
what I have come up with so far. If anyone could take a look at it and
possibly show me where I have gone wrong I would be forever grateful.

Here is what I have so far:

Age=IIF(([Forms]![Age Selection Form]![Age Selection]="0-5"), >="0" And <="5")

I may be completely off but I was just trying to test with one of the age
ranges. I can add the rest once I get the basic part down.

Again, any assistance would be greatly appreciated. I thank you in advance
for your time and effort.
 
Back
Top