Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I placed all of the code in one module behind a form. I split it up into a couple procedures. There is a textbox control that is bound to a field in a table. This is there to ensure there is a record in the table and so the VBA code knows what record/row to place the file attachment to.

    It seems you got the file picker working by changing the a little, the code you copied. I copied the original version and placed the file picker code behind one control button's click event. I also put the strPath declaration at the top of the module in the general section. This way the other procedure and function know what the value is.



    What needed to be added is another procedure. I added this code behind a second control button. I split it up so you can start to see what is going on. This button opens the DAO recordset and then calls the function to do the Attach thing. After the function is called, the code in the second control continues. This second control and its code in the click event is the crucial part. Without this, and a couple other little tweaks, your DB is not going to function.

    You will have to look at the DAO and learn about DAO in general. I believe the example here is darn close to what you are tyring to accomplish. You have a form. The form is bound to a table/query. The current record of the form is where you want the user to attach a file of the User's choice. This is what the sample DB does.
    Attached Files Attached Files

  2. #17
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80
    Quote Originally Posted by ItsMe View Post
    Condescending or not I need to understand what your expectations are. It was a legitimate question. I spent a small amopunt of time reading your previous thread and then this thread. The impression I had was you don't understand what the code is doing or needs to do. Thankfully, for both of us, you chose to answer truthfully.

    I created a DB to test the automated addattach thing. I got it working. I will work on the second part using the picker. I will upload it here after a bit. I have to take the time to read the code, decipher it, and understand what it is doing.
    to be truthful i'm still fairly new to VBA in general, and i'm still deciphering fundamentals, so like i said, this is above my skill set. sorry if i got defensive, when i read that it came across as snide, even if you didn't mean it to.

    i appreciate your help and look forward to hearing back. this is something else for me to put in the toolbox for later.

  3. #18
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Check out post #4 and then Post #16. This is what you need to be focused on.

  4. #19
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80
    That's awesome. I played with your example and briefly looked at the code but didn't have the opportunity to try and assimilate it. I'll give that a go tonight. Thanks a million man. I'll let you know if I get this working. I'm going to try and make it all in one button, and if I do I'll post a copy of the code. I can't be the first person to have wanted to do this.

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

Similar Threads

  1. Invalid Argument Error Message
    By kcochran130 in forum General Chat
    Replies: 1
    Last Post: 05-30-2013, 08:20 AM
  2. Invalid Procedure Call or Argument
    By Trojnfn in forum Access
    Replies: 2
    Last Post: 10-29-2012, 01:44 PM
  3. Invalid argument
    By wharting in forum Import/Export Data
    Replies: 4
    Last Post: 10-19-2011, 11:49 PM
  4. Invalid Argument on update query in v2010
    By DropDeadDavey in forum Queries
    Replies: 2
    Last Post: 07-28-2011, 06:27 PM
  5. Invalid Argument Error
    By koper in forum Access
    Replies: 2
    Last Post: 06-14-2010, 11:22 AM

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