944,147 Members | Top Members by Rank

Ad:
Mar 14th, 2005
0

Change Query Parameters

Expand Post »
I change query parameters in my code.

i want the query to change her Sql property to new sql with new parameters.


Set QueryDef = CurrentDb.QueryDefs("q_QueryName")

QueryDef.Parameters("[Param_1]") = stringvalue_1
QueryDef.Parameters("[Param_2]") = stringvalue_2
QueryDef.Parameters("[Param_3]") = stringvalue_3
QueryDef.Parameters("[Param_4]") = "#" & Format(timevalue_1, "HH:mm") & "#"
QueryDef.Parameters("[Param_5]") = "#" & Format(timevalue_1, "HH:mm") & "#"

QueryDef.Parameters.Refresh

'QueryDef.Sql

DoCmd.OpenReport "r_ReportName", acViewPreview

The report "r_ReportName" need to run with new Query and new parameters.
But, actually the Query.Sql didn't change at all.
and microsoft JET still ask me for enter parameters ??
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
motid7 is offline Offline
1 posts
since Mar 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS Access and FileMaker Pro Forum Timeline: create a forum ?
Next Thread in MS Access and FileMaker Pro Forum Timeline: DBMS Questionnaire





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC