Updating a query def

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top