Results 1 to 4 of 4
  1. #1
    IDH is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    3

    Wrong number of arguments or invalid property assignment problem...

    Hi - I'm by no means a programmer but have fudged together a reasonably good DB. Last week it got corrupted and I followed a thread to decompile it which worked (on the whole). While the DB now works I don't think the debug completed as it throws out an error message "Wrong number of arguments or invalid property assignment" and highlights the code element below in red. Can anyone tell me what is wrong with this? I didn't even generate it - it is auto generated from one of the wizards?

    The problem I have is code after this element doesn't function properly - when I delete this segment the whole DB runs fine (apart from the bit I deleted). I'm hoping if I can fix this bit then all of it will run smoothly.

    Private Sub Command39_Click()
    On Error GoTo Err_Command39_Click



    Dim stDocName As String
    Dim stLinkCriteria As String
    DoCmd.SetWarnings False
    stDocName = "qryUpdatetask3"
    DoCmd.OpenQuery stDocName, , , stLinkCriteria

    Exit_Command39_Click:
    Exit Sub

    Err_Command39_Click:
    MsgBox Err.Description
    Resume Exit_Command39_Click

    End Sub

  2. #2
    DrGUI is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Parts Unknown
    Posts
    23
    What is stLinkCriteria?? Where do you define it? Also to debug, comment out Docmd.SetWarnings False statement and see what it gives you.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    OpenQuery does not have that many arguments. Try

    DoCmd.OpenQuery stDocName

    and don't forget to turn the warnings back on.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by DrGUI View Post
    What is stLinkCriteria??
    It is VBA variable that is automatically generated by Access when creating a command button that opens a report or form. Newer versions will generate a macro but I believe the VBA converter will still generate the same declarations.

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

Similar Threads

  1. Replies: 3
    Last Post: 07-18-2015, 05:02 PM
  2. Replies: 3
    Last Post: 02-12-2014, 03:36 PM
  3. Invalid reference to the parent property
    By Access_Novice in forum Programming
    Replies: 1
    Last Post: 12-28-2013, 05:17 PM
  4. Compile Error: Invalid user of property
    By jwill in forum Programming
    Replies: 16
    Last Post: 11-20-2012, 05:23 PM
  5. HELP - Invalid number of arguments
    By jgelpi16 in forum Programming
    Replies: 3
    Last Post: 07-22-2010, 09:38 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