then on the click event of the control in a form have the code like
dim mydb as database
dim myrec as recordset
set mydb = currentdb()
set myrec = mydb.openrecordset("Tblstats"
with myrec.addnew
!form_name = me.name
!Control_Name = whatever the name of the control is
!hit = 1
.update
end with
trick is to put it into a public funciton so you can call it anywhere in the db and pass teh fields as arguments then all you need to do is create a query and sum the totals of hits
or you could change it so it found the record for the control and jsut added one to the hit each time, as tehy say the choice is yours .....
Also, if you have user-level security enabled, you could include a username field in the table & populate it with CurrentUser(). This function returns the username - then you'd see who clicked how many times..... J. Jones
jjones@cybrtyme.com
Private Sub Aperçu_Click()
Dim mydb As Database
Dim myrec As Recordset
Set mydb = CurrentDb()
Set myrec = mydb.OpenRecordset("Tblstats"
With myrec
.AddNew
!Form_Name = Me.Name
!Control_Name = Aperçu
!hit = 1
.Update
End With
End
End Sub
I get an error message "2427" on the name of my Control_Name
....
i also tried
"!Control_Name = [Formulaires]![Critères-M-A]![Aperçu]" and "!Control_Name = ([Formulaires]![Critères-M-A]![Aperçu])" and "!Control_Name = [Aperçu]" and !Control_Name =![Aperçu]"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.