Solved

Making a sub-subform visible / invisible

Posted on 2009-06-30
3
640 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
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…

706 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

15 Experts available now in Live!

Get 1:1 Help Now