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

How to refer to a control through variable in a report in VBA? 1

Status
Not open for further replies.

inso18

Technical User
Dec 30, 2006
147
IL
Hi Everyone.

I'm having trouble in trying to refer to a control in a Report through a variable

So far I have attempted this:

(i = VBA variable, txb1, txb2 ... are report's controls)
Code:
Me("txb"& i).Caption = "1"
Reports!MyReport("txb"& i).ControlSource = "field" & i
Reports!MyReport!Report("txb"& i).Visible = False
None of these works.
Any ideas on how to do it correctly?

Much thanks, inso
 
me.controls("txb"& i).Caption = "1
 
Thanks, that works
in forms me.controls( isn't necessary though, me( is enough I'm not mistaken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top