Make form visible (1 Viewer)

pstraszynski

Paul Stras
Local time
Yesterday, 23:36
Joined
Dec 19, 2007
Messages
20
I want to make a form visible when a button is clicked. The following gives "Run-time error 424 object required".

Customer1SubForm.Visible = True

What do I need to change?
 

Alc

Registered User.
Local time
Today, 00:36
Joined
Mar 23, 2007
Messages
2,407
Have you tried specifying that it's a form? e.g.

Forms!Customer1SubForm.Visible = True

I don't know if it will help, but everywhere I've used that code, I've specifically included the 'Forms!' bit.
Also, as it appears to be a subform, how about

Forms![main form]!Customer1SubForm.Visible = True
 

pstraszynski

Paul Stras
Local time
Yesterday, 23:36
Joined
Dec 19, 2007
Messages
20
That didn't work

I tried
Forms!CustomerRegular!Customer1SubForm.Visible = True

When I click on the button, it says
"Run-time error 2465: Microsoft Access can't find the field 'Customer1Subform' referred to in your expression."

Do I have to declare the subform using a dim statement?
 

Users who are viewing this thread

Top Bottom