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

SubForm Visibility

Status
Not open for further replies.

MarkNie

Technical User
Sep 22, 2005
102
GB
Hi

I am having a bit of a problem with this VBA code. I am trying to set visibility for a subform. I have used a column in my table which has a tick mark if the form should be visible. I think my problem lies in calling the actual subform as it is a subform in a subform in a tab control on a mainform. If I do this with just a mainform and a subform it works perfectly.

This is the code I am using on the tickbox on the mainform which uses the active column in the table:

If Me.Active = True Then
Me.frmSubRetailResponsibilities01.Visible = True
Else
Me.frmSubRetailResponsibilities01.Visible = False
End If

This is also used on the mainform On Current event.

When I open the form I get the following Compile error message: Method or data member not found.

I have tried this too which has the all form names and the Control box name too and is also not working:


If Me.Active = True Then
Me.frmRetailTracking_Hub.TabCtl58.Page59.frmSubTracking_Hub01.frmSubRetailResponsibilities01.Visible = True
Else
Me.frmRetailTracking_Hub.TabCtl58.Page59.frmSubTracking_Hub01.frmSubRetailResponsibilities01.Visible = False
End If

Any help will be greatly appreciated.

Thanks
Regards
Mark

 
Hi PHV

Thanks for that. I have tried the following code but keep getting the following error:

Property let procedure not defined and property get procedure did not return object.

Forms![frmRetailTracking_Hub]![TabRetail]![January]![frmSubTracking_Hub01]![frmSubRetailResponsibilities01].visible=True

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top