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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Box Names in Forms and Arrays in Word 1

Status
Not open for further replies.

DLG0311

Technical User
Jan 6, 2005
13
GB
I have a fom that has six rows of six boxes (CC, DC, Neyt, VAT, Gross and VATC) these are currently named "CC1", "CC2" etc.

I have to fill each of the 6 VATC (ComboBoxes) with items (VATC1.AddItem "1 - Outside the Scope", VATC1.AddItem "2 - Exempt" etc).

To Shorten the code I'd like to use loops and arrays, but can't see it can be done as the box names can't be CC(1) etc which would fit with loops and arrays.

Ideas/solutions please?

In addition, the details from these 36 boxes are then used in a Word form and in "calculations".

Again, can these be extracted by loops? e.g.
For z=1 to 6
CC(z)= Form.CC(z)
next
 
i seem to recall an execute method in vb which might help.

if not i tend to loop through the Controls collection and have some sort of naming convention

For Each aControl In ThisDocument.Controls
If Left(aControl.Name, 4) = "upd_" Then
'do something
End If
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top