473,473 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

count click /w message box reminder

1 New Member
I am trying to count every single click i did in the command button.
And all i want to ask is what will the code be?
I want to do like this:
If a click once, a message box will appear that i have clicked it one time like that. Please help me :)
Jan 14 '16 #1
1 1102
mbizup
80 New Member
Do you need to keep track of clicks even when the database closes, or just for the current session?

If just for the current session, you would create a global variable and initialize it to 0 when the database starts up. TempVars are an alternative to global variables if you are using Access 2007 or later with the .accdb format.

If you need to store the click count for use the next time the database opens, you would need to create a field in a table for it....

With global variables or a field in a table (assuming the field is part of your form's recordsource), the code would look something like this in the button click event:

Expand|Select|Wrap|Line Numbers
  1. Something = Something + 1
Tempvars would use a different syntax... you'd initialize it in some startup code:
Expand|Select|Wrap|Line Numbers
  1. Tempvars.Add "ClickCounter", 0
and then increment it in your click event:
Expand|Select|Wrap|Line Numbers
  1. Tempvars("ClickCounter") = Tempvars("ClickCounter") + 1
Tempvars have an advantage over global variables in that they can be seen/used anywhere in the database... code, queries, property sheets, etc...

EDIT****
Apologies - I thought this was an MS Access question. this response might not apply. I imagine in VB, you could use a public variable for this. If VB.Net/asp.net, session variables.
Jan 14 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Brian Smith | last post by:
Is there a way to avoid the default action of TreeNode expansion/contraction caused by double click? I can add an event handler to pop up my properties dialog on double click, but it has the...
11
by: Thom Little | last post by:
I would like three states on an icon ... Left Click Right Click Double Click Left Click is fired at least once on a Double Click Is there a good example that shows how to determine if the...
1
by: Raj | last post by:
Hi, I am trying to send message (WM_CLICK) to a button control in a PowerBuilder application using a C# spy program. This works for all other windows applications but in case of PB application...
7
by: RobKinney1 | last post by:
The subject line sounds a little funny, let me quickly explain: I have created a custom control using ComboBox. But inside my class, I need to know when the user does NOT click my control. Of...
2
by: jonathan184 | last post by:
Hi I am having a problme where the results of the sql count is not matching the results of the perl script sql count. The script was working fine up till Wed last week and after that the results...
16
by: spud379 | last post by:
I am trying to count the amount of times that a button is clicked and when it is clicked 10 times I want to bring a message box. I have tried doing this with an if statement and a loop. with the...
0
by: bigwillno2 via AccessMonster.com | last post by:
I am very new in this and i am struggling with this.... can anyone help... what i am trying to do is get on a report , vendor, qfill, Countofqfill but i keep getting repeated qfill, instead of the...
3
by: paitoon | last post by:
I want to know how to count messge unread in inbox,And how can the message that was not read will be the read color and after read it will be the normal color as read messages? How it work and what...
3
Shakss2
by: Shakss2 | last post by:
Hi, I have a application which creates a task in outlook on the click of a button. I have made set reminder true. It works fine when it tried on the desktop. But wne tried the same...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.