Need a Count Of Pages Where Values Have Been Entered

J

jamie

I am creating a form that has a Tab Control with multiple pages on it.
All of the pages contain different ways that users can select the
records they need. What I realized is that I need a way of getting a
count of all the pages that have selection criteria entered on them.

In a simplified way of explanation here is what I mean:

My form has a page where users can enter a state that a person lives in
and a page where they can select the person's age.

I essentially need to know if they had entered 'state' criteria, 'age'
criteria or both to get the records they need.

The trouble is that both of these pages (and I will be using over 20
such pages) have multiple ways of selecting - individual states,
individual ages, age ranges, etc etc .

So, what I would like is some code that will look at all the fields on
the page and if any fields are filled out return a value 1 else 0. And
give me a total of all the '1''s.

(Sorry if this is long winded and thanks for any help!)

Jamie
 
J

John Vinson

I am creating a form that has a Tab Control with multiple pages on it.
All of the pages contain different ways that users can select the
records they need. What I realized is that I need a way of getting a
count of all the pages that have selection criteria entered on them.

In a simplified way of explanation here is what I mean:

My form has a page where users can enter a state that a person lives in
and a page where they can select the person's age.

I essentially need to know if they had entered 'state' criteria, 'age'
criteria or both to get the records they need.

The trouble is that both of these pages (and I will be using over 20
such pages) have multiple ways of selecting - individual states,
individual ages, age ranges, etc etc .

So, what I would like is some code that will look at all the fields on
the page and if any fields are filled out return a value 1 else 0. And
give me a total of all the '1''s.

(Sorry if this is long winded and thanks for any help!)

Jamie

You can loop through the tab control's Pages collection, and loop
through each page's Controls collection. See the VBA help for "Page".

John W. Vinson[MVP]
 

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