Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Dynamic OR AND

Author  Topic 

sqlpui
Starting Member

1 Post

Posted - 2010-11-15 : 21:06:54
Hello, I would like help in creating dynamic OR, AND. While querying, user should be able to choose whether they want to query AND by ticking on the checkbox. By default, the query is OR. Thank you.

SMerrill
Posting Yak Master

206 Posts

Posted - 2011-04-29 : 22:51:00
Please follow my logic here:
1. This means you will need a form in which the CheckBox control is hosted. Let's call this "ParameterForm".
2. This means you will need to launch ParameterForm before the query is built.

The query is feeding something like a report, form, or another query.
1. If the query feeds a report, the parameter form should be launched in the Report_Open() event handler. this is because the Report_Open event handler takes a parameter (Cancel as Integer). If the user chooses to cancel the parameter form, or closes it in an attempt to cancel the report, you will need a way out.
2. The ParameterForm design should contain the CheckBox, and two buttons named "cmdCancel" and "cmdPrint", along with the labels necessary to instruct the user what they are doing.

---
I see this topic is going to take a lot more time to explain; how the report launches the form which feeds the logic to the query, which feeds the report. I'll write it up and make a link here.

Please let me know if this is describing your situation properly.


~ Shaun Merrill
Seattle area
Go to Top of Page
   

- Advertisement -