Solved

Making a sub-subform visible / invisible

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

809 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