Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80

    debug.assert in the addattachment error handler. since it says "always stop here when debugging", i tried deleting it and all i get is the error, no debug.

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Did you run Debug > Compile from the VBA editor menu?

    Need to disable the error handler for debugging purposes. It's there for the benefit of users so they don't get caught in an infinite loop or some other critical error but error handlers really get in the way for debugging. Comment out the On Error GoTo line until everything is working.

    Set a breakpoint in your code and step through.

    Review link at bottom of my post for guidelines on debugging techniques.

    The code worked perfectly for me.
    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. #18
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80
    Set fldAttach = rstChild.Fields(m_strFieldFileData)

    here's the line throwing the "item is not in this collection" error

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Did you put the 3 Const declaration lines in the module header? Those 3 variables shown at the beginning of the code sample in article go in the header because they are refrenced by multiple procedures. If you don't want the other procedures, can put those declarations within the AddAttachment procedure.
    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. #20
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80
    damn didn't even notice those were there haha. new error: fldAttach.LoadFromFile strFilePath "invalid argument"
    it's only one line, but hey it's progress haha.

    i know about some troubleshooting and debugging, but this subject matter is above my head. again, thank you june for all your time and patience.

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Well, I did make note of them in post 15.

    Don't know what else I can do. The code works for me in Access 2010. Can't replicate the error.

    Don't even know if I could run your db under 2010. Are there any 2013 features used? Want to provide it?
    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.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 08-15-2013, 08:33 AM
  2. Replies: 10
    Last Post: 09-15-2011, 03:58 PM
  3. Command Button to Find .doc file
    By cg1465 in forum Forms
    Replies: 8
    Last Post: 09-15-2010, 08:28 AM
  4. Replies: 1
    Last Post: 07-27-2010, 02:27 PM
  5. Create a command button to Browes for file
    By sawill in forum Programming
    Replies: 3
    Last Post: 03-15-2009, 05:02 PM

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