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

Using expressions between brackets [ ]

Status
Not open for further replies.

eleteroboltz

Technical User
Jan 5, 2009
7
BR
Hey guys, I'm having some problem here when i try to use a formula between brackets [].
What I'm trying to do is very simple. The better way to explain is with an example:

I just want to write this line:

Me.[cv100].Caption = 33

in this way:

k=100
Me.[("cv" & k)].Caption = 33

Thank you
 
Me.("cv" & k).Caption = 33
which is shorthand for
me.controls("cv"& K).caption
 
One thing. If you use proper naming conventions:
no spaces
and no reserved words
you never have to use brackets (except in sql).

If you name your control "myControl" not "my control" you can simply
me.myControl or me!myControl

Also you can always use dot notation
me.("my control")
only need the brackets for
me![my control]
or a reserved word like
me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top