Link to home
Start Free TrialLog in
Avatar of davecocks
davecocks

asked on

Making a sub-subform visible / invisible

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

ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davecocks
davecocks

ASKER

Perfect!!!!   That's been driving me nuts!!!
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