This is based on SP. I have different fields one among them is the date field. I want to set the parameters so that the user would input the start and end date and he would get the records for that specified date range.
Yes, but depending on how you are call the SP the parameters will be loaded differently. A Form or Report has an Input Parameters Property. Executing from vba code you could load the parameters with a Command Object, or you could build then in dynamic SQL.
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.