filters

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

Guest

i have created a form with four combo boxes and a toggle button.
each combo refers to a macro with ApplyFilter action. i want the form to
apply all or some of the filters according to the selection of the combo.
the problem is that only one filter is applied each time. how can i achieve
multiple filters with macros?
the toggle button refers to a macro with GotoControl and SetValue actions. i
want a specific field in the detail section of my form that is not visible to
become visible and vice versa according to the selection of checkbox (toggle
button). i cannot get my toggle button to work.
all macros are in the OnChange property of each control in my form. how can
i make the combos and my toggle button work properly?

pls help me!
 
Angie,

Please provide the details of the macro on the toggle button. Or what
actually is it, a toggle button or a checkbox? But anyway, what are the
actions and arguments of the macro? I think you should be using the
After Update event.
 
it is a check box and the arguments of the macro are:
GotoControl = ControlName (field name) and then
SetValue: item = [Forms]![FormName![Field name]
expression = [Forms]![FormName].[Visible]
i have assigned the macro both on the on change and on the after update
event but it is not working.
p.s. in the form the i have set the field's property as not visible. i want
it to become visible only with the checkbox.

how about the combos and the multiple filters? how can i make them work
"tpgether"? i do not have a clue about SQL that' why i want to use the macros!

pls help me solve this problem!!!

Ο χÏήστης "Steve Schapel" έγγÏαψε:
 
Angie,

Just a hint: When providing examples in newsgroups, it is always best
to give the *exact* information. If possible, copy/paste from your
database.

I do not understand what ControlName refers to in the GoToControl
action. It can't be the one you want to make visible, I presume,
because if it is not already visible, the GoToCOntrol will fail.

As regards the SetValue action, it looks like you have missed out a ']'
at the end of 'FormName', so that might be the problem. Otherwise, if I
understand you correctly, the arguments would be like this:
Item: [ControlName].[Visible]
Expression: Yes

If this doesn't help, please try to explain exactly what you want, using
the names and values of the controls.

As regards the comboboxes and the ApplyFilter macro, once again it is
very difficult to answer with no details to work with. But I think you
will need something like this as the Where Condition argument of the macro:
([SomeField]=[Forms]![YourForm]![FirstCombo] Or
[Forms]![YourForm]![FirstCombo] Is Null) And
([AnotherField]=[Forms]![YourForm]![2ndCombo] Or
[Forms]![YourForm]![2ndCombo] Is Null) And
([FredField]=[Forms]![YourForm]![3rdCombo] Or
[Forms]![YourForm]![3rdCombo] Is Null)
 
i will try to revise the macros based on your hints. i hope it will work out
this time, otherwise i will post a detailed question.

thank you very much anyway!!!

Ο χÏήστης "Steve Schapel" έγγÏαψε:
Angie,

Just a hint: When providing examples in newsgroups, it is always best
to give the *exact* information. If possible, copy/paste from your
database.

I do not understand what ControlName refers to in the GoToControl
action. It can't be the one you want to make visible, I presume,
because if it is not already visible, the GoToCOntrol will fail.

As regards the SetValue action, it looks like you have missed out a ']'
at the end of 'FormName', so that might be the problem. Otherwise, if I
understand you correctly, the arguments would be like this:
Item: [ControlName].[Visible]
Expression: Yes

If this doesn't help, please try to explain exactly what you want, using
the names and values of the controls.

As regards the comboboxes and the ApplyFilter macro, once again it is
very difficult to answer with no details to work with. But I think you
will need something like this as the Where Condition argument of the macro:
([SomeField]=[Forms]![YourForm]![FirstCombo] Or
[Forms]![YourForm]![FirstCombo] Is Null) And
([AnotherField]=[Forms]![YourForm]![2ndCombo] Or
[Forms]![YourForm]![2ndCombo] Is Null) And
([FredField]=[Forms]![YourForm]![3rdCombo] Or
[Forms]![YourForm]![3rdCombo] Is Null)

--
Steve Schapel, Microsoft Access MVP
it is a check box and the arguments of the macro are:
GotoControl = ControlName (field name) and then
SetValue: item = [Forms]![FormName![Field name]
expression = [Forms]![FormName].[Visible]
i have assigned the macro both on the on change and on the after update
event but it is not working.
p.s. in the form the i have set the field's property as not visible. i want
it to become visible only with the checkbox.

how about the combos and the multiple filters? how can i make them work
"tpgether"? i do not have a clue about SQL that' why i want to use the macros!
 
Back
Top