Hello,
In Access 2003 I create a query which for one field was link to a value on a form.
Now I have to duplicate this form and instead to duplicate this query I wanted to use a parameter inside this query for one field and then via VBA call this query and give a value for this parameter.
My query name is: Query_Parameter
Fields inside: "Asset_Name" and "Isin"
Parameter is under the "Isin" field: [Look_Isin]
My VBA code is:
When I run the code nothing happen
Can someone help me?
Thank you ion advance.
Regards,
Michel.
In Access 2003 I create a query which for one field was link to a value on a form.
Now I have to duplicate this form and instead to duplicate this query I wanted to use a parameter inside this query for one field and then via VBA call this query and give a value for this parameter.
My query name is: Query_Parameter
Fields inside: "Asset_Name" and "Isin"
Parameter is under the "Isin" field: [Look_Isin]
My VBA code is:
Code:
Sub Test_Call_ISIN()
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Dim rst As DAO.Recordset
Set dbs = CurrentDb
'Get the parameter query
Set qdf = dbs.QueryDefs("Query_Parameter")
'Supply the parameter value
qdf.Parameters("Look_ISIN") = "LU0402212806"
'Open a Recordset based on the parameter query
Set rst = qdf.OpenRecordset(dbOpenDynaset)
End Sub
When I run the code nothing happen

Can someone help me?
Thank you ion advance.
Regards,
Michel.