Using Radio Button To Change Property of Another Control

  • Thread starter Thread starter Paul Cross
  • Start date Start date
P

Paul Cross

On a form I have an option group ("Filters") that has 26
buttons/letters A - Z. This option group has a macro attached to its
After Update Event ("FilterCustomers") that filters a Customer field
according to what letter is clicked.

What I want to do is create another macro ("FilterNames") that filters
according to the Name field. And then a user could use a 2nd option
group with 2 radio buttons (Customer and Name)to specify whether the
letters filter by Customer or Name.

So the radio buttons would only need to change which macro
("FilterCustomers" or "FilterNames") is attached to the After Update
Event of the option group with 26 letters. Know what I mean?

I don't know how to do it. Can someone help me out?

Sincerely,
Paul Cross
 
Paul Cross said:
On a form I have an option group ("Filters") that has 26
buttons/letters A - Z. This option group has a macro attached to its
After Update Event ("FilterCustomers") that filters a Customer field
according to what letter is clicked.

What I want to do is create another macro ("FilterNames") that filters
according to the Name field. And then a user could use a 2nd option
group with 2 radio buttons (Customer and Name)to specify whether the
letters filter by Customer or Name.

So the radio buttons would only need to change which macro
("FilterCustomers" or "FilterNames") is attached to the After Update
Event of the option group with 26 letters. Know what I mean?

I don't know how to do it. Can someone help me out?

Sincerely,
Paul Cross

Each of the macros will have to have conditional code in them. I'd suggest
abandoning them and use VBA.
Pseudo code:
If ButtonPushed = 1 then
filter based on one thing
else
filter based on another thing.
End If
 
One Pointer from me:
Open NorthWind Sample database.
The same thing is in the Customer Phone List Form.
There is an Option group...
Now open the Macros, and the Customer Phone List Macro.
 
Back
Top