Results 1 to 5 of 5
  1. #1
    BLD21 is offline Advanced Beginner
    Windows 2K Access 2007
    Join Date
    Apr 2011
    Posts
    55

    Report Macro

    access 2007,

    I have a report that is using a query as the source. I am using a macro to run the query. What I can't figure out is how to run the report once the query is closed. I am trying to set this up in the macro. But the report runs prior to the query closing.

    Any help is appreciated!
    Bruce D.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,969
    No need to 'run' the query, just open the report.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    BLD21 is offline Advanced Beginner
    Windows 2K Access 2007
    Join Date
    Apr 2011
    Posts
    55
    To clarify,
    I have a macro that runs a query that is used in a report. When the query runs I need to have the query open in datasheet edit mode. When I am done editing I want to close the query and then have a form open when the query is closed. I can't seem to find a way to wait until the query is closed before the form opens in the macro. Or can this be handled in the event procedure?
    Last edited by BLD21; 06-13-2011 at 06:58 AM.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,969
    You are doing data entry/edit directly in query? I recommend using form for this. Then code that opens form can control sequence of events and things don't happen until you want them to. For instance, open form with Dialog parameter and code execution is suspended until form closes. Can't do this with a query.

    I don't use macros, only VBA. Easer to debug and more versatile.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    BLD21 is offline Advanced Beginner
    Windows 2K Access 2007
    Join Date
    Apr 2011
    Posts
    55
    Yes, I agree. I should have thought about using a form earlier. It is working fine now.

    Thanks for your help!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 01-12-2011, 12:43 PM
  2. Replies: 1
    Last Post: 12-21-2010, 09:27 AM
  3. Replies: 3
    Last Post: 04-22-2010, 08:52 PM
  4. Replies: 1
    Last Post: 04-07-2010, 08:49 AM
  5. Replies: 1
    Last Post: 05-01-2009, 07:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums