Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Use Msgbox in macro? (Access 97)

    I have a macro (print1) that does the following: Hourglass; OpenReport;Client Reports, PrintPreview)
    It opens Reports, calls the report name(Client Reports) and shows it in Print Preview.

    How can I have it call another macro/code when I "Close" the Preview, asking if I want to rerun the report or exit/quit. I went into the report in Design mode and went into Properties and on "On Close" call print1 (the macro). This didn't work. Would it work if I tried adding a Msgbox in my macro?

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Use Msgbox in macro? (Access 97)

    Access things are all event driven, so a macro or VBA normally runs to completion. Thus you need two macros (or VBA procedures) to do things like you suggest. (There is at least one exception dealing with dialog style forms and message boxes - in those cases the code stops executing until you respond to the dialog or message box.) Hope this helps.
    Wendell

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Use Msgbox in macro? (Access 97)

    As Wendell suggests, you'll have to do it from code. There is no way to trap events from a macro, only from code. Try looking up WithEvents in on-line help.
    Charlotte

Posting Permissions

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