Hello,
I'm working on Access 2010 with data on SQL Server 2008 R2.
I want to open a form linked to a stored procedure.
To do that, I have followed these steps :
1) Create the stored procedure on SQL Server that we could call "pr_example"
2) Create a query on Access named "pr_example" with this SQL code inside :
EXEC pr_example
3) In the form, called "frmExample", I have set "pr_example" as record source
4) In my code that open the form, I have done the following :
dim qryFrm As QueryDef
Set qryFrm = pdbmydb.QueryDefs("pr_example")
qryFrm .SQL = "EXEC pr_example" & frmmyForm!LotID
docmd.OpenForm "frmExample"
msgbox Forms!frmExample!TbxID
This code open "frmExample" when clicking on a button in the form "frmmyform".
I'm getting error "Run-time Error 40036 - Application-defined or object-defined error" when trying to execute "msgbox Forms!frmExample!TbxID".
I'm also getting the tooltip "method item of object forms failed" on the "Forms!frmExample!TbxID" line.
I don't understand why :banghead:
Many many thanks in advance for your help.
Chris
I'm working on Access 2010 with data on SQL Server 2008 R2.
I want to open a form linked to a stored procedure.
To do that, I have followed these steps :
1) Create the stored procedure on SQL Server that we could call "pr_example"
2) Create a query on Access named "pr_example" with this SQL code inside :
EXEC pr_example
3) In the form, called "frmExample", I have set "pr_example" as record source
4) In my code that open the form, I have done the following :
dim qryFrm As QueryDef
Set qryFrm = pdbmydb.QueryDefs("pr_example")
qryFrm .SQL = "EXEC pr_example" & frmmyForm!LotID
docmd.OpenForm "frmExample"
msgbox Forms!frmExample!TbxID
This code open "frmExample" when clicking on a button in the form "frmmyform".
I'm getting error "Run-time Error 40036 - Application-defined or object-defined error" when trying to execute "msgbox Forms!frmExample!TbxID".
I'm also getting the tooltip "method item of object forms failed" on the "Forms!frmExample!TbxID" line.
I don't understand why :banghead:
Many many thanks in advance for your help.
Chris