I’ve been writing MS Access apps for a long time. I just switched to Access 2010 and now wherever I open a form in which I’m creating the InputParameters in code, the app prompts me to enter the parameters. I’m baffled and can’t figure this out.
The following code has worked on all previous versions of MS Access until Access 2010:
Dim strRS As String
Dim lngID as Long
Dim intSomethignElse as Integer
strRS = "dbo.StoredProcedureName"
lngID = 1
intSomethignElse = 2
Forms!SomeFormName.InputParameters = "@parameter1 = " & lngID & ", @parameter2 = " & intSomethignElse
'Verify the parameters do indeed exist and they do:
Debug.Print Forms!SomeFormName.InputParameters
Forms!SomeFormName.RecordSource = strRS
Now when the form loads I get prompted to enter @parameter1 and @parameter2.
How do I get this to work again in MS Access 2010?
Any help is appreciated.
I had the similar VBA code. It worked fine in Access 2010 until recently and I got the same issue as the pop up window asking for parameters.
After I change the code to simliar to
as Remou suggested in the comments, my application works again.