Changing forms properties

G

Guest

I have a subform called [Short Service Contract Details] whose "Visible"
property is set to "No". I want to change the visible property to "True"
based on the After Update of a combo control. I've used the following code:
Forms![Short Service Contract Details].Visible=True.
The following error message is received:
"... can't find the form 'Short Service Contract Details' referred to in a
macro expression or Visual Basic code". What am I doing wrong?
 
G

Guest

I assume you are calling this from a main form. In that case try

Forms!frmMain![Short Service Contract Details].Visible=True

and if possible try to rename the subform to a form without spaces... for
future use

hth
 
G

Guest

The subform has a name just like any other control on your form. Highlight
the subform on your main form and get its Name property. Then you can use
it's visible property. When you use Forms![Short Service Contract Details]
you're trying to call the actual Form's propert, rather than the Subform
control.
 

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