Selecting rows from a query issue...

  • Thread starter Thread starter Brad Pears
  • Start date Start date
B

Brad Pears

I my Access 2000 project, I am using a "select" clause to select certain
rows from a query - as opposed to a table. The query I want to select the
rows from just happens to include a field in it that has a criteria of
"forms![frmPricing].[ContractNo]". I am using this query in another place
that needs that criteria there.

At the time when this select clause runs, that criteria field is available
to the query. However, in my code, as soon as I execute the "set
rs=currentdb.openrecordset(strSQL)" command (after I have built the SQL
clause), I get a "too few parameters. Expected 1' error.

Is there anyway to get around this type of error? I could build another
query that does not include the criteria field specifically for this
particular chunk of code, and include an additional statement in my SQL
clause, but if there is a way to be able to select from a query that
includes the type of criteria I am having the problem with, that would be
better to know...

PS... Including a direct criteria like some specific text (ex...="Testing")
or numeric value (ex...=1) does not cause a problem - it's only when the
criteria references some other field ie... in my case a form field...

Confused?

Thanks,

Brad
 
Back
Top