Gustav Brock
Gustav at cactus.dk
Wed Aug 9 11:53:48 CDT 2006
Hi Chester
You are opening a second instance of the query with DoCmd. ..
Replace it with:
MyQDef5.Execute
/gustav
>>> Chester_Kaup at kindermorgan.com 09-08-2006 17:53:20 >>>
I am trying to pass parameters to a make table query with the following
code. The part that passes the parameters works fine for a select query.
When I run the code the query still asks for input. What do I need to do
different to make it work for a make table query?
Set MyQDef5 = MyDb.QueryDefs("qry Injected Volume Total around
Producer")
PatternName = "PAT 145-4"
Set myds2 = MyQDef2.OpenRecordset()
WellName = myds2.Fields(1)
MyQDef5.Parameters![Pattern Name] = PatternName
MyQDef5.Parameters![WellName] = WellName
DoCmd.OpenQuery "qry Injected Volume Total around Producer",
acViewNormal, acEdit
Chester Kaup
Engineering Technician
Kinder Morgan CO2 Company, LLP
Office (432) 688-3797
FAX (432) 688-3799