I have a join query I need to run that takes in two parameters (startDate and endDate of Type Date) and it pulls two of its fields from two other parameter queries that use the same parameters. If I execute this as a saved query from the database window it works flawlessly. I'm assuming it passes those parameters on to its component queries since they use the same names.
The problem is I need to run this query programatically (so I can insert the parameters programatically. The problem is that by using the method of inserting the parameters with variables (ie "select * from tblTable where " & x & " = " & y) replaces those prarameters with static values and they're no longer really parameters and so they don't get inhereited by the other queries in the join. I figure I could use DAO's querydef object instead, but I'm trying to avoid DAO as ADO is set to supersede it. Also the other recordsets involved are ADO. Everything is contained in the same .mdb file (or linked tables within it).
I guess the concise question is: How can I build this join parameter query programatically so that the parameter queries in the join can inherit the parameters passed to the join query in ADO? Or do I have to use DAO querydefs?
90% of what I know about VBA/Access is self taught while working on the job, so I might be missing something that would make it easier.
The problem is I need to run this query programatically (so I can insert the parameters programatically. The problem is that by using the method of inserting the parameters with variables (ie "select * from tblTable where " & x & " = " & y) replaces those prarameters with static values and they're no longer really parameters and so they don't get inhereited by the other queries in the join. I figure I could use DAO's querydef object instead, but I'm trying to avoid DAO as ADO is set to supersede it. Also the other recordsets involved are ADO. Everything is contained in the same .mdb file (or linked tables within it).
I guess the concise question is: How can I build this join parameter query programatically so that the parameter queries in the join can inherit the parameters passed to the join query in ADO? Or do I have to use DAO querydefs?
90% of what I know about VBA/Access is self taught while working on the job, so I might be missing something that would make it easier.