Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Bypassing the Main Report (Access2003)

    Hello everyone!
    As everyone knows by now - I have Report with 4 subreports in it.

    It happened that I had received request to hide the column and have it displayed on demand.

    Report name is Candidate_History
    Subs are Candidate_Applied
    Candidate_1
    Candidate_2
    Candidate_3
    Candidate_4

    The column to make invisible is Salary.

    I had made all the Salary Invisible-True.

    Now if someone wants to see the Salary - I added another button - Run with Salary.

    I wanted to have code on click of this button where it says
    Candidate_1.Salary.Visible=True
    Candidate_2.Salary.Visible=True
    Candidate_3.Salary.Visible=True
    Candidate_4.Salary.Visible=True

    Except I have to get trough Main Report - Candidate to get to the 1,2,3,4

    What is the code to reach Salary on SUBs
    will that be
    Candidate.Candidate_1.Salary.Visible=True

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Bypassing the Main Report (Access2003)

    You could define a global variable blnShowSalary and set it to True or False in the On Click event of the command button. Use this variable in the On Open event of each of the subreports:

    Private Sub Report_Open(Cancel As Integer)
    Me.Salary.Visible = blnShowSalary
    End Sub

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Bypassing the Main Report (Access2003)

    You declare a global variable in a standard module - the kind of module that you create by selecting Insert | Module in the Visual Basic Editor:

    Public blnShowSalary As Boolean

    One button would set the variable to True and open the report, the other would set the variable to False and open the report.

  4. #4
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bypassing the Main Report (Access2003)

    Got it , THANKS!


    I had created a new Module for the Global variable, is that correct way to go?

Posting Permissions

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