Solved

Making a sub-subform visible / invisible

Posted on 2009-06-30
3
641 Views
Last Modified: 2013-11-27
Hi,

Form:                  groupSurvey
subform              survey
sub-subform:      subform_landSightings

I'm trying to make a sub sub-form visible / invisible from a button click on the main form.

subform_landSightings is a subform of survey.

The code below gives this       ERROR:  

Run time error 2455  
 You entered an expression that has an invalid reference to the property Form/Report

Thanks.

If Forms!surveyGroup.survey.Form.surveyTypeID.Value = 2 Then

     MsgBox "is Land"
 

    Me!survey.Form!subform_LandSightings.Form.Visible = True
 

Else

    Me!survey.Form!subform_LandSightings.Form.Visible = False

End IF

Open in new window

0
Comment
Question by:davecocks
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 400 total points
ID: 24746805
Try this:

Me.survey.Form.subform_LandSightings.Visible = True   '  False

mx
0
 
LVL 1

Author Closing Comment

by:davecocks
ID: 31598399
Perfect!!!!   That's been driving me nuts!!!
0
 
LVL 75
ID: 24746972
You were close.  The last 'Form' reference is not required.  That's only needed if you were referring to a control on the sub-sub form.

See this link for the ultimate reference in form/subform ... report/subreport systax

http://www.mvps.org/access/forms/frm0031.htm

mx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now