Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Through Query - Parameters?

Status
Not open for further replies.

ssecca

Programmer
Feb 13, 2002
219
US
I have a pass-through query that has two dates as parameters. The problem is those dates need to be changeable. I thought it would be a simple VBA statement to just delete the old query and create a new one as and when needed. It appears it is not, or I am missing a key point. Is there a simple way to call a SQL procedure with changing parameters. I want this pass-through to be available for a report.

Thanks
 
Have you looked at this?


Also, if your report runs at specific intervals, weekly, monthly, etc you can caluclate the dates in the stored procedure instead of manually entering the dates.


Trisha
padinka@yahoo.com
 
I create a basic pass-through query and then use DAO to change the SQL property.

Code:
Dim strSQL as String
strSQL = "EXEC stpMySP '" & Me.txtStartDate & "', '"& _
    Me.txtEndDate & "'"
CurrentDb.QueryDefs("qsptMyPT").SQL = strSQL

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top