How do you count button clicks? (1 Viewer)

DT

Registered User.
Local time
Today, 11:16
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
 

Jack Cowley

Registered User.
Local time
Today, 19:16
Joined
Aug 7, 2000
Messages
2,639
Use an update query behind each button to increase the count in your audit table by one.
 

Fizzio

Chief Torturer
Local time
Today, 19:16
Joined
Feb 21, 2002
Messages
1,885
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

Top Bottom