?
Solved

how can I add numbers in vb6?

Posted on 2007-09-27
3
Medium Priority
?
671 Views
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:
999999
thanks in advance
0
Comment
Question by:blackbookcoder2
  • 2
3 Comments
 
LVL 4

Assisted Solution

by:Beldoran
Beldoran earned 1000 total points
ID: 19976093
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

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

Assisted Solution

by:Beldoran
Beldoran earned 1000 total points
ID: 19976101
your for statment could also be

For x = 157 to 999999 step 1
0
 
LVL 8

Accepted Solution

by:
Anthony2000 earned 1000 total points
ID: 19976121
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")
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

850 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