Petr Danes
Registered User.
- Local time
- Today, 05:57
- Joined
- Aug 4, 2010
- Messages
- 150
I call parameter queries from VBA fairly often, and they work fine - set a reference to the query, load the parameter and the query can then be used as a recordsource:
I also use chains of queries - usually to do some sort of grouping or summing. Query A sets up a selected set of something, Query B groups all stuff from Query A, Query C summarizes stuff from Query B, and so on.
What I would like to do occasionally, and have never been able to figure out, is to chain a set of queries when one of the earlier ones is a parameter query. I have not been able to figure out how to feed a parameter to, say Query A, then open Query C as a recordsource. It keeps jumping up with a dialog box, asking for user input. I don't want that - I want to feed the parameter in by code.
Code:
Set qdf = CurrentDb.QueryDefs("HypsoSouhrn")
With qdf
.Parameters("ID Druhu") = 2669
End With
Set rst = qdf.OpenRecordset
I also use chains of queries - usually to do some sort of grouping or summing. Query A sets up a selected set of something, Query B groups all stuff from Query A, Query C summarizes stuff from Query B, and so on.
What I would like to do occasionally, and have never been able to figure out, is to chain a set of queries when one of the earlier ones is a parameter query. I have not been able to figure out how to feed a parameter to, say Query A, then open Query C as a recordsource. It keeps jumping up with a dialog box, asking for user input. I don't want that - I want to feed the parameter in by code.