In the sample below gProdOrder is a global variable that was set elsewhere. In your case it would be the reference to a form field.
Dim WgtDB As Database
Dim QD1 As QueryDef
Dim TempSet1 As Recordset
Set WgtDB = CodeDb
Set QD1 = WgtDB.QueryDefs!QProdOrdersReprint
QD1.Parameters![ProdOrder] = gProdOrder
Set TempSet1 = QD1.OpenRecordset
Hi Pat,
this is very helpful to me too. Could you tell me how this situation would look like if the parameter was not in the query that you actually wanted to open but in a previous query that this one refers to.