I am new to Access and I am coming from C#, SQL Server & .Net. There is a project that has come my way and I have to complete some parts.
The scenario may be described as:
Parametername1 String(255),Parametername2 String(255)
.My plan is to set the values of the above mentioned query parameters within a procedure in my VBA code module. I believe this should refresh my subform as the query is the datasource for the subform.
The problem is I don't know how to implement this plan.
I want to use a query because I don't want to mess up my VBA Code with inline SQL.
I am using Access 2010.
I had exactly this question, I wanted to use the same 'stored' update query but execute it from two different forms so wanted to pass the parameter to the query at run-time. This is what I found (in another forum) that does exactly what I want:
With CurrentDb.QueryDefs("qry_YourQuery")
.Parameters("yourParam") = yourVBAvar
.Execute
End With