Updating a query def

G

Guest

I am trying to update a query def, so that when I run a
parent query, the sub query will have the parameter it
requires. Here is what I have, and it doesn't appear to
be working (still getting the "too few Parameters"
error) Any advice?

gVarProdID (defined at form open before this is run - and
populated - I checked)
Dim QDef As QueryDef
Dim db As Database
Set db = CurrentDb
Set QDef = db.QueryDefs("XPS Comp Calculation
Query")
gVarProdID = [Forms]![XPS Comp Calc Form]![ProdID]
QDef![[Forms]![XPS Comp Calc Form]![ProdID]] =
gVarProdID
 
D

Douglas J. Steele

If you've got the parameter named [Forms]![XPS Comp Calc Form]![ProdID],
then the form named XPS Comp Calc Form must be open when you run the query.
 

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