Kaup, Chester
Chester_Kaup at kindermorgan.com
Wed Aug 9 12:46:02 CDT 2006
Thanks! Works great.
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Wednesday, August 09, 2006 11:54 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Parameters to make table query
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
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com