using Me with subform

G

GeorgeMar

"Me" can be used in a loop, such as when I want to turn a
number of controls visible by doing something like:

for i =1 to 5
me("ControlName" & i).visible=true
next

When I do the same thing with a control on a subform it
doesn't work. I get: "Control not found ..."

Here is what I have:

for i=1 to 5
me("SubformName.form.ControlName" & i).ColumnHidden=True
next

Can you tell me if what I am doing is possible?

many thanks
george
 
R

Rick Brandt

GeorgeMar said:
"Me" can be used in a loop, such as when I want to turn a
number of controls visible by doing something like:

for i =1 to 5
me("ControlName" & i).visible=true
next

When I do the same thing with a control on a subform it
doesn't work. I get: "Control not found ..."

Here is what I have:

for i=1 to 5
me("SubformName.form.ControlName" & i).ColumnHidden=True
next

Can you tell me if what I am doing is possible?

Try...

for i=1 to 5
me.SubformName.form("ControlName" & i).ColumnHidden=True
next
 
G

GeorgeMar

Thank you Rick. It worked.

George
-----Original Message-----


Try...

for i=1 to 5
me.SubformName.form("ControlName" & i).ColumnHidden=True
next


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com



.
 

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

Top