Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178

    Unanswered: Report DefaultView property setting in A2007

    I'm working with a set of reports in A2007. The users want to be able to view the reports alternately in Continuous view and in Print Preview. I tried to give them this ability by giving them a combobox to choose the DefaultView property, but no matter what I do I get a run-time error message saying something like "If you want to set this property, open the report in design view and set it there." However, the help file is clear that the property can be set in VBA.

    I tried bypassing the combobox by putting the appropriate code (Me.DefaultView = 1 (or 0)) alternately into the Activate, Load, and Open events of the report object. In Activate, Access ignored the code altogether. In the other two events I got the error message.

    Please help.

    Thanks,
    Sam

    PS. For what it's worth, this is my maiden voyage into A2007. I've been using XP forever. Except that it's harder to find things in '07, it's not bad. Maybe I'll upgrade someday.

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    I found a workaround for the problem. Along with the DefaultView property, Microsoft also made in A2007 a corresponding view attribute, acViewReport, so the correct code to use is
    Code:
    DoCmd.OpenReport "ReportName", acViewReport
    for a continuous 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
  •