Set Paramter in Subqueries

M

Martin

Hello,

i have a Query with a lot of subqueries.
But i have 2 Paramters in a Subquery.
When i open the report in Access, Access ask me for the values of the 2
Paramters.

Now i want to automate it.
I use Visual Studio 2005 and C# language.

When i open the report with OpenReport( .... ) a can add a where clause.
But this is for the main query and not for one subquery.

i need help.

thx a lot
Martin
 
M

Maurice

Hi Martin.

I guess we need a little more to go on. Have you go anything yet (some
sql-statement) of what you are trying to accomplish..

Maurice
 
M

Martin

I use OpenArgs to send the Paramters.
In the Report_Open Event, i read the values.

i catch the query with ..
Set db = CurrentDb
Set query = db.QueryDefs(Me.RecordSource)

i try to set the Parameter Values.
query.Paramters(0).Value = date_from
query.Paramters(1).Value = date_to

When i call the Report it ask me agaiin for the parameter values.

I also try to catch the sql text and set the paramters manually. (Replace
String)
Then Icall
Me.RecourdSource = newSQLText

Didn´t work.

Thx a lot
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top