Count Button Clicks

jtodd

Board Regular
Joined
Aug 4, 2014
Messages
194
Hi , simple one , just need to count how many times and when a button is clicked on a form
IE When the user clicks a button on the form it writes a record to a table
Click
Date
Time

Seems quite simple but has got me foxed.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You need to explain where exactly you want this data stored.
All you said was clicks a button on a Form. Do you mean Userform?
It writes a record to a Table
Where on a Table?
 
Upvote 0
You need to explain where exactly you want this data stored.
All you said was clicks a button on a Form. Do you mean Userform?
It writes a record to a Table
Where on a Table?

Sorry I explained that very badly - what I need is this ,

I have a form "frm_ordno" and a button "viewreport" and a table "countrpt"

the table fields are "count" "time" and "date" with "count" I am guesing would be an autonumber?

What I would like is when the user presses the button to view the report it writes a record to the countrpt table thus creating a record of how many times and when the report was accessed .

I hope this makes it clearer . I have some knowledge of VBA but am definately a beginer.

Any help would be greatly appreciated.
 
Upvote 0
All you said was clicks a button on a Form. Do you mean Userform?
My Aswer Is This,
I think you missed the fact that you are in the Access forum again, not the Excel forum. Forms are pretty standard thing in Access...

jtodd,

So, you have a table named "countrpt" that has the fields "count", "time", and "date"?
Is the form a Single Record form, or a Continuous form?
Does clicking the button add a new record to your table, or just update an existing record on a table?
Note that in updating the count, you would be updating the "count" record on a particular record, specifically the record that you are currently on.
If you just want a total count, you probably need a separate one-record table that tracks that, and we would need to update that.

Also note that you would NOT want your "count" field to be an Autonumber field. The Autonumber field is not updateable. It is automatically created whenever a new record is added. You probably would want to use something like a Long Integer.
 
Last edited:
Upvote 0
Your correct my mistake.
My Aswer Is This,
I think you missed the fact that you are in the Access forum again, not the Excel forum. Forms are pretty standard thing in Access...

jtodd,

So, you have a table named "countrpt" that has the fields "count", "time", and "date"?
Is the form a Single Record form, or a Continuous form?
Does clicking the button add a new record to your table, or just update an existing record on a table?
Note that in updating the count, you would be updating the "count" record on a particular record, specifically the record that you are currently on.
If you just want a total count, you probably need a separate one-record table that tracks that, and we would need to update that.

Also note that you would NOT want your "count" field to be an Autonumber field. The Autonumber field is not updateable. It is automatically created whenever a new record is added. You probably would want to use something like a Long Integer.
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,221,805
Messages
6,162,081
Members
451,738
Latest member
gaseremad

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top