Dynamic Queries

  • Thread starter Tereza Zambrano
  • Start date


Tereza Zambrano

I have been trying to create a dynamic query, it works for
some of the variables, then it stops, when I try to look
at the sql code its HUGE and wont open..here is my code
Basically I have a dialog box with 10 fields, and set 10
parameter in my query ( exactly the same order as the
This critieria for the 10 fields:[Forms]![FrmDynamic]!
[DMPC]Or Like [Forms]![FrmDynamic]![DMPC] Is Null
When I make a selection the cmd button calls the query.
Please help...



[MVP] S. Clark

Anything more than one parameter, especially when an OR condition is needed,
I switch to the method of creating the SQL string in VBA code.


Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!



Dennis Schmidt

Hi Tereza,

My name is Dennis Schmidt. Thank you for using the Microsoft Newsgroups.

The following article on creating a truely "dynamic" query is the way to go:

Query by Form (QBF) Using Dynamic QueryDef


I hope this helps! If you have additional questions on this topic, please
reply to this posting.

Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights

Dennis Schmidt
Microsoft Support

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

Similar Threads

dynamic queries 4
Dynamic query 1
dynamic query 2
Dynamic Query 2
dynamic queries? 1
Dynamic queries 1
Dynamic query 3
Dynamic Query 1