Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts

    Access 2007 - Open report in accordance with combo

    Friends, I am trying to create a report with many fields and tables of different (but related).

    As I have many fields, had to do subreports so that the fields to print perfectly.

    I have a button on a form, and I'm trying to open the report in accordance with each company that is
    selected in a combo.

    Before I had a report that I opened with this line of code:

    DoCmd.OpenReport "steps", acViewPreview, , "[CompanyID]='" & Me.combCompany.[Column](0) & "'"

    But now, as I have subreports this code does not work.

    Does anyone have any tips?

    Thank you.

  2. #2
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Hi Fabio,

    Are the subreports based on queries that depend on the value of the combo? That would be a solution for the problem. If you are expecting them to open in other circumstances, as well, there are options to do that, but that adding a criteria based on the value of the combo, to the queries the reports are based on, would be my first option.

  3. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-05-24)

  4. #3
    2 Star Lounger
    Join Date
    Jan 2012
    Posts
    155
    Thanks
    118
    Thanked 0 Times in 0 Posts
    hello Rui,

    Sorry Rui and friends. I was trying to open an integer with a string. Fix and it worked.

    Thank you.

  5. #4
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Glad that it worked .

  6. The Following User Says Thank You to ruirib For This Useful Post:

    fabiobarreto10 (2012-05-25)

Posting Permissions

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