[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1800
  • Last Modified:

Invalid Procedure Call or argument

I have an Access database that was originally created in Access 2003, it is now in Access 2010.  Now when I click on any of the buttons, one to add a new record, one to close the form, etc, I get Invalid procedure call or argument.  I think it is a reference issue, but I don't know what reference should be added.  None of the references are missing.

Any help would be appreciated.

Thanks,
Joan
0
jmkbrown
Asked:
jmkbrown
  • 6
  • 4
  • 3
  • +1
1 Solution
 
Ken ButtersCommented:
Your description of the issue is pretty vague...

I think you are going to have to add more details around what error you are getting.

if it was a missing reference... we'd need to understand what code was being executed...  what does it do?   what objects is it trying to create (if any)?  etc.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"Invalid Procedure Call or argument"
That error is not really associated with a missing / or Reference issue.

Can you post some code - specifying where error occurs ?
0
 
jmkbrownAuthor Commented:
The code for the add button is:

Private Sub cmdAdd_Click()
On Error GoTo Err_cmdAdd_Click


    DoCmd.GoToRecord , , A_NEWREC
    [txtDIG#].SetFocus
    [txtDIG#] = txtDIGCount + 1

Exit_cmdAdd_Click:
    Exit Sub

Err_cmdAdd_Click:
   

    Resume Exit_cmdAdd_Click
   
End Sub

The code for the close button is:

Private Sub Stop_Click()
On Error GoTo Err_Stop_Click


    If Me.Dirty Then Me.Dirty = False
    DoCmd.Close

Exit_Stop_Click:
    Exit Sub

Err_Stop_Click:
    MsgBox Err.Description
    Resume Exit_Stop_Click
   
End Sub
 

Both of these get the error Invalid procedure call or argument.  Both of them get it on the Private Sub statement.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
Bill RossCommented:
Hi,

Does the code compile?  

Regards,

Bill
0
 
jmkbrownAuthor Commented:
No it does not.
0
 
Bill RossCommented:
Hi,

If it does not compile then there is a missing reference but not in the module above.  What message do you get when you compile?

Bill
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"No it does not. "

Then this is your first issue to resolve.

Where do the compile error occur ?

mx
0
 
jmkbrownAuthor Commented:
The error is Invalid procedure call or argument.  I am not sure where it is getting the error, it does not highlight any code.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Well, I was referring to Compile errors.  All bets are off until you fix those.

"nvalid procedure call or argument." only occurs when code is executed.  But with compile errors,  again ... everything is indeterminate until those are fixed.
0
 
Bill RossCommented:
Hi,

Press Ctrl-G and open the code window.  Click Debug, Compile.

Where does the code stop?  What message?

Regards,

Bill
0
 
jmkbrownAuthor Commented:
From the code window, when I select Debug, Compile I get Invalid procedure call or argument.  This code did work when the database was in Access 2003.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Interesting.  Can you upload a version of the db that exhibits this issue ?

mx
0
 
jmkbrownAuthor Commented:
When I moved the form and necessary data to a new database the form is now working.  I think the database must be corrupt.  I will move the rest of the objects and see if this fixes my problems.  

I will let you know what I find.

Thanks,
Joan
0
 
jmkbrownAuthor Commented:
It was my own solution.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now