Results 1 to 2 of 2
Thread: Creation of a Drag Box
2013-10-11, 04:11 #1
- Join Date
- Sep 2013
- Thanked 0 Times in 0 Posts
Creation of a Drag Box
I have multiple search boxes in my form like Name, Pages, Year, Email, University etc....
Instead of displaying all the search boxes with the names I wanted to create a dragbox for those search boxes.
Dragbox (Should contain all the names of the search boxes)
If we select "Name" in DragBox then we can search for Name
If we need to add another DragBox. Then there should be a button named "Add Another Filter". If we click on this button then another dragbox needs to be displayed and this time we can select "University" and search for the relevant records.
I was unable to bound the text box with those dragbox.... could you kindly help me out.
Kindly have a look into the attached file.
Open MFORM. I designed drag box and the text box at the right end.
I just need one search button too at the bottom of my dragbox.
If I select Authors in the drag box and entered "ABC" in text box and then press on enter should return all the Authors which contains "ABC"
I don't know how to do this. Can any one help me out in doing this or else just ping me out with a relevant video on this please.....
Let me know if you are not clear with my requirements.
2013-10-12, 20:11 #2
- Join Date
- Jul 2010
- Seattle, WA., USA
- Thanked 12 Times in 12 Posts
I'm not sure what you have in mind with your "Dragbox" concept, but I did have a quick look at your sample database. I noticed several text boxes for your search parameters, along with references to each text box in 'squery', a query that serves as the recordsource for your subform.
First, you will want to rid your existing code of all compile-time errors. Your main form has references to two controls, cbxName and cbxFilter, which are not present. On my machine, this resulted in 13 "Enter Parameter" prompts before the form opened with all records displayed in the subform. You will not see this effect if you have the VBA Editor settings for Compile On Demand checked (the default). This is a global setting that does not 'travel' with your database, so you may not want others to experience this if they open your application.
I also recommend that you set the VBA option to Require Variable Declaration in all new modules. This will give you the very important Option Explicit for newly created modules. You can find these options by opening the VBA Editor, and then clicking on Tools | Options... The Require Variable Declaration option is on the Editor tab, and the two Compile On Demand options (Background Compile and Compile On Demand) are found on the General tab. My advice: Enable (check) Require Variable Declaration, and disable (uncheck) both Background Compile and Compile On Demand. I also recommend deselecting the "Auto Syntax Check" option, on the Editor tab. I have a different name for this option: The carpel tunnel option, since it simply results in a modal error message, that you generally have to click your mouse to dismiss. Errors in VBA code are generally obvious, as they are shown in red font by default. Also, add the very important Option Explicit as the second line of code to the top of any existing modules, since the Require Variable Declaration option checked only kicks in for newly created modules.
I have two QBF (Query By Form) samples posted on the Seattle Access web site:
Look for the January 8 and February 12, 2008 downloads. The first one, for 1/8/2008, is much easier to implement but not quite as versatile.Tom Wickerath
Microsoft Access MVP
4/1/2006 - 3/31/2012