The way I handle parameters is to put them as public variables in the standard module and have the user enter the variables on a Form.
In standard module.
Public pubBegDate as Date
Public pubEndDate as Date
Public Function ReturnBegDate() as Date
ReturnBegDate = pubBegDate
End Function
Public Function ReturnEndDate() as Date
ReturnEndDate = pubEndDate
End Function
On Form where user enters dates.
Put a Button and use OnClick event.
In OnClick event after user enters the dates.
pubBegDate = textboxBegDate
pubEndDate = textboxEndDate
Dim DocName As String
Dim LinkCriteria As String
DocName = "MyForm"
DoCmd.OpenForm DocName, , , LinkCriteria
Under the data tab of myform
Record Source = mysproc
Input Parameters =
@begdate=ReturnBegDate(),@enddate=ReturnEndDate()
The names @begdate and @enddate are the parameter names in the Sproc.