Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Creating an incramental counter

Posted on 1999-01-19
Medium Priority
Last Modified: 2010-05-03
I need to create a counter that will count in incraments of 1 every time I click a command button, and display the number on a label on the same form.  Any suggestions would be mucho appreciated.
Question by:agenda
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 12

Accepted Solution

mark2150 earned 150 total points
ID: 1469439
put this in Form_Load

Command1.tag = 0

PRIVATE Command1_Click()
count = val(command1.tag)
count = count + 1
command1.tag = count
label1.caption = count


Author Comment

ID: 1469440
This did not work, it say's cannot assign to a read only property.  I tried it in the form_load and the command button.  but it has not worked
LVL 12

Expert Comment

ID: 1469441
Oops! COUNT is a reserved word. Change it to CNT and it'll work.



Expert Comment

ID: 1469442
Email me if you want a cool odometer control

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question