Results 1 to 5 of 5

Thread: Msg Box ? (97)

  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Msg Box ? (97)

    OK, so I'm stupid.

    I have the following import code that works fine except for 1 thing. If the user cancels before the import, they get the Msg, if the user completes the import they still get the Msg. What do I need to do to only give the msg if the user cancels?

    Thanks.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Msg Box ? (97)

    I'm stupid to. I can't see the code.
    Francois

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Msg Box ? (97)

    I told u I was stupid....lol....too early....sorry

    Here's the code:

    On Error GoTo Err_Cancel_Click

    DoCmd.RunCommand acCmdImport

    Err_Cancel_Click:
    MsgBox "You Choose to Cancel the Import", vbOKOnly

    If I use MsgBox Err.Description instead of my code...it works fine.

    Thanks
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

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

    Re: Msg Box ? (97)

    Roberta,

    You need an Exit Sub before the Err_Cancel_Click label. Otherwise, the code simply continues executing right into the error handler because you didn't tell it to stop.
    Charlotte

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Msg Box ? (97)

    Thank you Charlotte...works like a charm!
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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