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

S

SHIPP

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?
 
T

Tom Ellison

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
 

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