variables and for next statements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I currently have this code

ME.WD_FULL_HRS.VISIBLE = TRUE

ME.TX_FULL_HRS.VISIBLE = TRUE

ME.ITAG_FULL_HRS.VISIBLE = TRUE

there are many more fields of the same naming convention.

Ok, what I would like to do is:

For Each GRP in ("WD","TX","ITAG")
FHRS = "ME." & GRP & "_FULL_HRS"
EXIT FOR
NEXT

FHRS.VISIBLE = TRUE

Is this possible?
 
Biggles said:
I currently have this code

ME.WD_FULL_HRS.VISIBLE = TRUE

ME.TX_FULL_HRS.VISIBLE = TRUE

ME.ITAG_FULL_HRS.VISIBLE = TRUE

there are many more fields of the same naming convention.

Ok, what I would like to do is:

For Each GRP in ("WD","TX","ITAG")
FHRS = "ME." & GRP & "_FULL_HRS"
EXIT FOR
NEXT

FHRS.VISIBLE = TRUE


Dim Itm As Variant
Dim Grp As Variant
For Each Itm IN Array("_FULL_HRS", . . .)
For Each Grp In Array("WD", "TX", "ITAG")
Me(Grp & Itm).Visible = True
Next Grp
Next Itm
 
That is the kind of thing I was looking for, I will try it this weekend,
thanks.

Sean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top