Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Location
    Raleigh, NC
    Posts
    183

    Red face Unanswered: Hiding Fields in reports

    I have created form where uer can type in date range to filter out the reports. And when reports is open report also shows date range which user have selected on the form. How can i hide the field in reports based on what user choose on the form. For example: If user only chooses the "txtStartDate" then in report i would like to hide "txtEndDate"
    Skharva

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Use an if or case statement to determine which fields the user filled in and show/hide the appropriate report controls.

  3. #3
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    You would need an if statement.

    Code:
    If txtStartDate = "" Then
        'Open the report in design mode and
        'find the name of the object you wish to hide
        yourobjectname.visible = false
    ElseIf txtEndDate = "" Then
        'do the same as above
        yourobjectname.visible = false
    End If
    Insert that code right after the docmd.open report.

    If you have any questions let me know.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  4. #4
    Join Date
    Sep 2003
    Location
    Raleigh, NC
    Posts
    183

    Exclamation

    How can i reference object name which is on report from the form. I have form where user enters the date range and then the report is preview...

    One more question

    I have report where i have following fields

    #Patient #Enrolled #Not Enrolled
    ----------------------------------------

    What i would like to do is add another field to this report called "Time Frame" so i can preview reports by time frame. Basically, i would like to see #Patient...#Enrolled....#Not Enrolled for this week...next week...last week...

    Any idea how to do that

    Thanks in advance
    Skharva

  5. #5
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    You can use openargs to pass values to the report from the form. If the form stays open behind the report's print preview you can reference controls on the form from the report.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •