Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count number of clicks on an unbound form

Status
Not open for further replies.

Melee

Programmer
Jun 20, 2000
50
US
I have an unbound form that is used to write a series of SQL statement to a temporary table. The purpose is to use the data from the check boxes and option selections to run a report based on the occurances of the Company in the temporary table.

This database has more than 500 check boxes and the client wants to be able to find any number of matches with those "true" instances.

I set up the query so that the user has to input the number of boxes/options checked. They are unhappy with this solution and would like the number automatically utilized.

Is there a routine or method that would count the number of clicks and save that count some place that could be fed into the query?
 
Are you saying that you have 500 checkboxes on a form and need to count how many of them are set to yes? I'm not sure I understand the design here. . . Joe Miller
joe.miller@flotech.net
 
The database has about 500 yes/no check boxes -- some of them are checked, some are not

The form to which I am referring is unbound and has about twenty-five selection boxes on it. As the user checks these boxes, records are written to the temporary table. Also on this form are buttons which open additional forms of a similar nature which perform the the same write to the table function.

After the selections are made on the forms, the user clicks on a button to run a report based on a query that counts the number of times a record is written to the temporary table. Example: The user clicks on "Supplier", "Organic", "wine", and "Australia", The query then looks for all companies that have four occurances in the temporary table. The user must keep track of the number of selections and enter that number to get the result. They don't want to do that extra step.

So I am seeking a solution to count the number of clicks and feed it into the query.

 
The easiest way to do it off the form would be to make an unbound textbox and set it's control source equal to this:

=Abs(nz([Check1])+nz([Check2])+ ... +nz([Check25]))

The "..." is Check 3 through 24 and after that's done that textbox can be referenced in your code as it will contain the number of items that have been checked Yes.

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top