Results 1 to 7 of 7
  1. #1
    LadyL is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    32

    Problem with running code to insert previous record data in form

    My database runs fine, the final element that I need to work is that my button "Gegevens invullen" in the form "Vondsten" does not work. I get the error Invalid Argument. This code works fine on other forms however. I've already omitted 'categorie' in case it would cause problems, but no solution. Any ideas? Also I cannot seem to edit my last posts in order to remove the database from them.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    I think regular members can edit posts for only a limited time. A moderator can edit posts at any time. I have done so. Most posters aren't concerned with leaving attachments. I will look at your revised db.
    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. #3
    LadyL is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    32
    Thank you, really appreciate your help

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Still get compile errors with your code. Still get errors on missing members for Zoekformulier - why? I would expect these issues to be resolved by now. Have you run Debug Compile? There is an Option Explicit line in the middle of code just above the CarryOver function. Remove that line.
    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. #5
    LadyL is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    32
    Ah yes, I don't actually use that code for Zoekformulier, so I've removed it. And I have removed the Option Explicit, but still no luck.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    The CarryOver function has 3 arguments but you are trying to pass 4. I find it odd that the compiler does not error on the function call with 4 parameters. Are the last two parameters accepted as elements of the array expected by the function? I never tried passing array elements like this. What is data in the array for? It seems to be a list of controls that should be skipped in the looping structure. Should multi-value comboboxes be skipped?

    Only cause of issue I can see is that the record includes a multi-value field. Copying multi-value field data to another record requires code that manipulates a child recordset. Review: https://www.accessforums.net/program...vba-21259.html

    But you say other forms work even though they have multi-value field involved.
    Last edited by June7; 06-30-2015 at 11:53 AM.
    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.

  7. #7
    LadyL is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    32
    I figured it out, it seemed it was because of the categorie field. I changed the relationship type and it suddenly works.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-03-2014, 02:07 AM
  2. Replies: 5
    Last Post: 06-16-2013, 05:25 PM
  3. Problem with INSERT INTO query code
    By rghollenbeck in forum Queries
    Replies: 8
    Last Post: 09-27-2011, 12:16 PM
  4. Replies: 3
    Last Post: 09-13-2011, 07:58 PM
  5. Replies: 4
    Last Post: 09-09-2011, 10:00 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