how can I add numbers in vb6?

Posted on 2007-09-27
Last Modified: 2008-01-09
I need to add some numbers in vb6 and don't know how to do this.  Here's what i want to do:

000157 I need to make this number go up by one over and over until the number gets to:
thanks in advance
Question by:blackbookcoder2
    LVL 4

    Assisted Solution

    There are a few ways to do this. The easiest may be a for loop

    For variable = startvaue to endvalue
       Whatever code you want to do with it
    Next variable

    For x = 157 to 999999
     'do something with x
    Next x
    LVL 4

    Assisted Solution

    your for statment could also be

    For x = 157 to 999999 step 1
    LVL 8

    Accepted Solution

    and if you want x to be displayed in a textbox (labeled TextBox1) with leading 0's, then use the format command:

    TextBox1.text = Format(x, "000000")

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Introduction This article makes the case for using two modules in your VBA/VB6 applications to provide both case-sensitive and case-insensitive text comparison operations.  Recently, I solved an EE question using the LIKE function.  In order for th…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    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…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now