Results 1 to 4 of 4
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Fullt qualified report reference with variable (XP)

    Not sure I understand, but you can do something like this:

    Dim strReport As String
    strReport = "rptMyReport"
    ...
    With Reports(strReport)
    .Filter = strSQL
    .FilterOn = True
    End With

    Note the use of .Filter instead of just Filter.

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Fullt qualified report reference with variable (XP)

    In addition to Hans' comments, you could add:


    strReport = me.openArgs

    so that you could use the form to filter different reports.


    You might to test that openargs has gopt something in it.
    Regards
    John



  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Fullt qualified report reference with variable (XP)

    Thanks both of you. I was going to use openargs to get the report name but I was having trouble with the reference.

    Hans, that was exactly what I was after, I had completely forgotten you could reference things using Reports("ReportName") or Forms("FormName") even though I've seen it in help recently - long day <img src=/S/confused.gif border=0 alt=confused width=15 height=20> (which included the inability to read/type properly)

    All is working well now <img src=/S/smile.gif border=0 alt=smile width=15 height=15> cheers

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Qualified report reference with variable (XP)

    I've got a form which contains a number of combo boxes. This is used to filter another form. I'm trying to modify a copy of the form to use as a popup to filter some reports. The new form will be opened when a report is loaded and I though if I passed the report name via openargs I could use this later to set what is actually being filtered when i click a button on the form.

    The problem is I need to fully qualify the report reference so I can set its Filter and FilterOn properties, e.g.

    With Reports!rptMyReport.
    Filter=strSQL
    FilterOn=True
    End with

    I can't figure out how to do, getting the report name from a string variable. Is this possible?

Posting Permissions

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