Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Eliminating Error Message (2002)

    Hi,

    I'm importing information from an excel spreadsheet. I get an error message regarding data that isn't imported for various reasons. This is fine since I don't need the data. Is there any way to stop the alert that automatically pops up as the user doesn't need to see it.

    The code I'm using to import is as follows:

    DoCmd.TransferSpreadsheet acImport, 8, "tblPOCTracking", "C:SSISSAM FilesCare Manager FilesSAM POC Tracking", True, ""


    Thanks,
    Leesha

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Eliminating Error Message (2002)

    Do you currently have any error handling code in the procedure?

    If so, take note of the error number when the problem occurs and add a line to the error handler that says:

    (where xxx is the error number

    if err.number = xxx then
    resume next
    else
    your current error handler
    end if
    Regards
    John



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

    Re: Eliminating Error Message (2002)

    Does it help if you insert

    DoCmd.SetWarnings False

    above the DoCmd.TransferSpreadsheet line, and

    DoCmd.SetWarnings True

    below it?

  4. #4
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Eliminating Error Message (2002)

    Thanks! That did it. To answer John's question, there was no error handler in the code and although I tried approaching it that way before posting this, I had no luck.

    Leesha

Posting Permissions

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