Help with access form

slyce

New member
Local time
Today, 01:01
Joined
Jul 18, 2007
Messages
7
Hello everyone,
I have run into a dead end creating a form in access like one i saw in use in a foxpro database. I have attached is a screenshot to assist anyone who can help. It performs a search of a tables using one combo box to select options for the field to search, and another to select an operator e.g. equals to,greater than, between, in. And a text box for value.
There is a duplicate of these combo boxes and textbox below the ones described above. In between is an option box that you can use to select AND, OR logical operators to further define your search.
I have been unable to figure out how to create a combox box of operators and an option box of logical operators, can any one help me?:confused:
 

Attachments

  • Screen shot.JPG
    Screen shot.JPG
    21.4 KB · Views: 157
Is the attached the sort of thing you are looking for?

It will need some error trapping before it becomes truly user friendly though.
 
Thanks John

Hey John,
I just came online and found your reply to my post, profound thanks for responding to my desperate plea for assistance. I've looked at the search form and i think it's pretty nifty, I hope to go over it very carefully ASAP. Would mind sharing how you came up with the search form, I had pretty much made up my mind it had to be a filter. Do you have any suggestions about the error trapping? Thanks once again.
 
Hi Slyce

If you open up the query in design mode you will see that I have used a logical argument (IIF Statement) to determine which of the search criteria to use. I have also constructed two queries one for the "Or" search and the other for the "And" search. Which one is run is determined once again by a logical argument behind the search button.

I have used a pair of cascading combo boxes on my form however you might not want to limit your user in that way.

As far as making the search more user friendly, first I would make the two queries open behind forms, you will of course need to rejig the code behind the search button.

Secondly if the "And" search is selected you must force the user to make a selection in the second combo. This could be done in a number of ways, the easiest would be to use two independent ComboBoxes (rather than a cascading pair) and have a default value. If however you choose to retain the cascading Combo set you will need to put some additional code behind the search button to check and ensure that a selection has been made in the second combo. Finally I would add a test to check if the search has any results or not.

Hope that helps
 

Users who are viewing this thread

Back
Top Bottom