Re-Using Search Form (1 Viewer)

BarkerD

Registered User.
Local time
Today, 14:35
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.
 

cpuSmoker

Registered User.
Local time
Today, 06:35
Joined
Oct 16, 2004
Messages
31
Let me see...

Regarding the slow bit, when was the last time you 'repaired and compacted' the database?

Not sure how? Start database, Click tools menu, Database Utilities, Compact & Repair database. This will help alot with the 'slow' problem and should be done regularly.

Regarding the find form, maybe the openargs property can be specified when opening the form could be an sql statement that would supply the information the form would need to operate? I have a find/replace utility which works in this manner, but you can also programmatically minipulate the find form from the form that opened it, IE:

Forms!frmFind!cboSearchString.RowSource = "SELECT * FROM tblWhatever ;"

In this manner you can change any of the controls on the find form from the opening form without having to create a dozen of the same 'FIND' forms each for a specific purpose.

Hope this helps. :cool:
 

Users who are viewing this thread

Top Bottom