How do you count button clicks?

DT

Registered User.
Local time
Yesterday, 18:54
Joined
Oct 23, 2000
Messages
83
I have many different forms and tables. Is it possible to have one Audit table so when a user clicks a button on the different forms the Audit table tracks the clicks?

Maybe on one form have many buttons that dump into the Audit table.

I have tried to set up an Audit table with 2 fields. [Autonumber] and [Counter]. On a form I created a button, OnClick says this:

Private Sub cmdCounter()

Counter = Counter + 1

End Sub

How do I get the form to find the Audit table?

Thanks,
DT
 
Use an update query behind each button to increase the count in your audit table by one.
 
The form does not necessarily have to have any link to the Audit Table, use a recordset to update the counter value. Use the DLookup function to find out the value in the Table ie

DLookup "[Counter]","Audit"

A progression from this would be to have an AuditTable with [Autonumber] and [ButtonName]. In this way you could count several ButtonClicks but give each button in your Db a separate name so to count these

DCount "[AutoNumber","AuditTable","[ButtonName] = 'NameOfButtonToCount'" You can then put this alongside the button in a visible or hidden field.

HTH
 

Users who are viewing this thread

Back
Top Bottom