I am not sure wha this is that you have written. How is the query being opened? If from a form, and the parameter appears in a control on a form, then you can create a SELECT query, and in the PeriodID field, put this in the Criteria in Design view:
[Forms]![frmYourForm].[dPeriodID]
Alternatively, you can pass a number with this syntax:
sLink = "[PeriodID] = " & dPeriodID
And a string with:
sLink = "[PeriodID] = " & "'" & dPeriodID & "'"
Then in the WHERE section of the OpenQuery command:
DoCmd.OpenQuery "QueryName", , sLink
Does this help?
mmcdonal
|