Hi,
I'd like to read a label on another form.
I thought it would be easy to just read
controls(Forms!form!subform!label1)
gives me an error the control does not exist.
Hi,
I'd like to read a label on another form.
I thought it would be easy to just read
controls(Forms!form!subform!label1)
gives me an error the control does not exist.
If I understand your question you have two forms open and want to read the value of a control on one of those forms. Below, may be a partial solution for you. It returns the value contained in the control, not the name of the control. Additionally if it is a label you would need to retrieve the caption property.
Code:
SomeValueForm1= Forms("Form2").Controls("text30")
However, if you have a form/subform set-up follow the advice of pbaldy.