Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Making a sub-subform visible / invisible

Posted on 2009-06-30
3
Medium Priority
?
655 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1600 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

688 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