Store a criteria in a string and use it in a query.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to store a criteria in a string and then utilize it in a query

GetCriteria() could be
=Like 2
etc

How can I store the criteria and then in a query use GetCriteria() to select the desired records?
 
Dear Shipp:

This can be done by having the function (or code using that function)
create the entire query string, then execute that string as a query.
This is a common alternative, and I know of no other way nearly as
effective.

The exception is if you're using MSDE, where you could have a stored
procedure that accepts the string from your function and then it
builds and executes the query. However, this is not radically
different from my suggestion above.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Back
Top