Results 1 to 2 of 2

Thread: Macro question

  1. #1
    Join Date
    Apr 2006

    Unanswered: Macro question

    I have constructed a simple macro that, when run, opens a query and applies a filter to the results. The effect is to limit the outcome of the query to records matching the ID of the form that is open. Unfortunately, Access then interposes a message box asking if the user wants to save the results of the query. The answer is no but having to deal with that each time is annoying. Any additional to the macro that will stop the message box from appearing? Thanks!!

  2. #2
    Join Date
    Apr 2004
    outside the rim
    Perhaps a different approach:

    Make a Form based on the query and set it to "datasheet" style. When you onen the form, you can add the filter to the OpenForm event that will automatically apply the filter to the form when it opens.

    When you close the form, include acSaveNo on the command line.

    The help file has good instructions on using both of these and the wizard will write the basic code for opening and closing forms when you create the buttons.

    This gives you much more control over what is happening, let's the user have the "spreadsheet" style results and still works nicely for exporting to Excel or using Copy/Paste.

    Have fun!

Posting Permissions

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