Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Xtab Report - Changing Control Source in VBA (Access 2007)

    I think I may have stumbled upon another Access 2007 "issue". I have a cross-tab report that Hans helped me with last year that changes the control source of various fields programatically in VBA. This works perfectly in Access 2003. Today, when I went to run it under Access 2007, the first page of the report opened properly in preview mode (as it should). However, when I go to the second page I get a message saying "Microsoft Access has stopped working" and Access closes. I should add that all other reports that don't change the control source programatically work perfectly.

    I found this article that sounds like my issue although it doesn't mention changing the control source via VBA. My question is: How do I get around this since the control source is being changed programatically? Wait for SR1?

    Thanks, in advance.
    Carol W.

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

    Re: Xtab Report - Changing Control Source in VBA (Access 2007)

    I don't have Access 2007 so I can't test this, but you could try the following:
    Use code in the On Click event of a command button on a form to
    - Open the report in design view.
    - Change the control source of controls, etc.
    - Save and close the report.
    - Open the report in preview mode.

    If you're in a multi-user environment, it will only work if
    a) the database has been split into a backend with tables and a frontend with queries, forms, reports etc.,
    AND
    [img]/forums/images/smilies/cool.gif[/img] each user has a personal copy of the frontend.

  3. #3
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Xtab Report - Changing Control Source in VBA (Access 2007)

    Hans:

    Thanks for the reply. Fortunately, I'm doing the development under Access 2007 but deploying the application to run under Access 2003. I also have a second machine on which 2003 is installed to do complete testing.

    I can see why IT folks would be very reluctant to upgrade to 2007. I don't do much in the way of development and this is the second incompatibility I've found.
    Carol W.

Posting Permissions

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