Re-Using Search Form

BarkerD

Registered User.
Local time
Today, 14:31
Joined
Dec 1, 1999
Messages
106
I have a Search form which I have created that is activated on a form by a command buton. This form allows the User to pick a value from a Combo Box and then this value is used for the filter criteria on the form.
This works great, but I would like to be able to re-use this form for all of my other Find buttons on different forms. Right now, I have just been creating a new form every time I need it.

I would like to be able to add some code in my command button click event which I can use to define the link criteria of the form, the row source of the Combo Box, and the Document name. These are the only things that I have been changing on the different forms. I would really like to cut some of the fat from my application, since it has been getting kinda slow lately. (Currently have about 6 of these forms that serve the same purpose, and about 6 more in the works)

I don't have much experience with using modules, and this is what I think I need. If someone could show me how to design this function, I would really appreciate it.
 
You can save yourself a lot of trouble by teaching your users to use Filter by Form. You would incur no overhead by using this functionality.

You can easily save a couple of steps by running a macro or code behind your "search"
button.

Paste the following two lines after you create a new button and select Code Builder on the on-click event of a new button. Make sure you turn the Wizard off on the toolbox:


Private Sub <Name of your button>_Click()
DoCmd.RunCommand acCmdFilterByForm
DoCmd.RunCommand acCmdClearGrid
End Sub

When the user clicks on the button, they will be in a real nice combination search screen. They can select multiple criteria from the drop downs, then all they have to do is press the "apply filter button" to see the result. If you have more than 1000 records, you will not see the drop downs until you go into tools-options-edit find and change the "don't display lists longer than" 1000 to a larger number...pick 9000.

My users love FBF. You will gain many hours by teaching them to fish instead of giving them a fish to feed them for the day.

You can then have all your forms use the same function.

Dave Mack Saratoga, NY
 
When I was first designing the Database, I thought to use the Filter by Form functionality. However my company is not willing to purchase full versions of Access for every user. I purchased the Office 2000 Developers edition, and am using the Run-Time version. The Run-Time version does not have the Filter by Form feature, so I am forced to create customized filtering.

The only thing I really need to figure out now, is how to specify the row source of the combo box programmatically. I think I'm pretty close, and any help would be appreciated.

Duane Barker
 

Users who are viewing this thread

Back
Top Bottom