View Full Version : Query Criteria Question


mlr0911
03-22-2007, 06:48 AM
Hello all,

I have a query that on occasion needs to have the criteria updated; however, I don't want to use the docmd.openquery in design method. My users aren't SQL savvy and I am afraid they may mook something up.

I need an idea on how to accomplish this. I thought of making a table with the criteria in it and making a form for the criteria; then using a form lookup from the query (combo box drop down etc). But most of the time, the criteria will be the same, I don't want the user to always have to go to the form.


Any ideas?


Thanks for your help.

boblarson
03-22-2007, 07:20 AM
You should be using forms for the users to access data. By letting users access tables/queries directly you are losing control of things and you do not have events to be able to validate, pass criteria, etc.

Check out this post for a sample that shows how to do multiple criteria dynamically.
http://www.access-programmers.co.uk/forums/showthread.php?t=99353

Moniker
03-22-2007, 08:02 AM
Or this post (http://www.access-programmers.co.uk/forums/showthread.php?t=119990).

Dynamic SQL isn't as hard as you may think it is.