State and Country filter

S

Stephanie

Hi. I have a macro that I'm using in a "rolodex" form- a form that you can
select a button for each state and the form will display all of the member's
that live in that state. All is well.

However, we have members that live outside of the US and I wanted a button
for "foreign", to show all members outside of the US.

So, I'm tyring to incorporate a macro that works for state and now country.
I'm not very talented with macros and have never used a macro group. I tried
to build a new option group on my form and that didn't go so well either.

I'd appreciate suggestions. Details are nice as well. Thanks.
 
E

Eric Blitzer

Create a filter and save it as a query.

create a macro and set the action "apply filter"
for the filter name use the query name you just created.
You cn ge the criteria from your form
 
S

Stephanie

Thanks for the reply- you seem to be the man holding down the majority of the
macro questions. I appreciate that.
I seem to be limping along and hope the deatils aren't too painful.
I created a filter by using the query that the form is built on, clicking in
the Country field where one of the entries reads United State, choose Filter>
Filter Excluding Selection, then only the entries without country = United
States appeared, and then I saved the filtered query. I hope I did that
correctly- once I saved the query, all records reappeared and the apply
filter icon isn't available.

I created the macro using apply filter, with the filter name as the name of
the filtered query. I'm a bit confused about the where condition, but decided
to go with
Where Condition [Forms]![Registered READ Team Phone List]![Country]<>"United
States". I hope I did that correctly.

I haven't applied the macro yet to the form, because I don't know how (more
later), but when I open the form in design view, the form shows Filter as
[Country]. On the form itself, all records appear but only non-US country
names appear. Which is cool (no need to list US over and over) although I
don't know why this happened. Is it correct?

Now, I'm not sure how to apply the macro to only the "Foreign" toggle button
that I created when I created all of the individual "State" toggle buttons in
an option group. "On got focus" was a bad choice: pop-up boxes for the values
of all of the criterion for my query kept appearing, locking up the system
(MemberOption needs to be 1 or 2, MemberType needs to be 1 or 2...).

Have I done anything correctly ;-) ? How do I activate the filter when I
click on the "Foreign" toggle button?
Thanks for the help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top