Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macro's

Status
Not open for further replies.

paulcat

Programmer
Mar 8, 2000
24
US
In Clipper, I was able to create a macro:
mfile = "NST" + left(sDate,2) + "-" + right(sDate,2) + ".DBF", which I would then reference in the program with the macro symbol &, such as "Use &mfile".

In VB, I have a series of form controls (option buttons), 4 across, 8 rows deep. The rows of buttons are named optComplete0(x), optComplete1(x), optComplete2(x), and so on. Is there a way to step thru a for...to loop, replacing the 0-8 following the "optComplete" with the for-to variable?? I have tried a number of different ways to do this, but keep getting errors. For example, I would assign to a variable:
For y = 0 to 7
myvar = "optComplete" & y
if myvar(1).value = True then ....
This doesn't work at all. What will??
 
Naming the controls similarly is not enough.
It's been awhile since I've used vb, but if you copy one
of your controls and paste it to the same form, vb will
ask you, Do you want to create a _________. Maybe
it's a control group, I don't remember. Anyway, that's
what you need, and then look under help for referencing
a control group (or whatever) member. It might be
brackets instead of parens. Anyway, this should get you
started, and others in this forum will help you more. Jim

oracle, vb
 
Thanks - you're referring to a control array, and each row of option buttons is in a control array, but each row is its own array. However, there are 8 rows and I would like to dynamically be able to refer to them, as I explained earlier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top