ACCESS 2007 REPORTS/SUB REPORTS - runtime error 94

Posted on 2011-10-13
Last Modified: 2012-05-12
I have two sub reports in my detail section in a access report.  The sub report display depend a value in my type field.  If the type field is blank or null I dont want any sub  report to display. I just want to preview the report as is.

Me.Child94.Visible = Me![ADF_TYPE] = 1
Me.rpt_sub_DA.Visible = Me![ADF_TYPE] = 2

I am receiving a runtime error 94 when the ADF_TYPE is blank or null.  Is there anyway to code around this get the report to display?
Question by:centralmike
    1 Comment
    LVL 100

    Accepted Solution

    Try this

    If IsNull(Me![ADF_TYPE]) then
        Me.Child94.Visible = False
        Me.rpt_sub_DA.Visible = False
        Me.Child94.Visible = Me![ADF_TYPE] = 1
        Me.rpt_sub_DA.Visible = Me![ADF_TYPE] = 2
    End if


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
    The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

    755 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