Customer Pop-up Search Form Question ? Can it be done ?

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

I have code on the form that accomplished what i want, but if i try and use
this same code with the pop-up form it does not work ?
Using a combo box to perform search. Combo2
i changed the comboc500 to combo2, no luck.
I would woul like very much just to create one master search form that
searches my forms for the criteria i need, but if not at least one for each
form.
Thanks,

Dave

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Order ID] = " & Str(Nz(Me![Combo500], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
 
Dave, are you aware that you can click in any bound text box on any form,
and then use the Find toobar button (Binocular icon)? There is also a Filter
By Form button on the toolbar if you prefer that.

If you are trying to create a popup to work with any form:

1. The code you posted refers to Me.RecordsetClone. This won't work if the
popup is unbound, i.e. you need to specify Forms("SomeForm") instead of me
if you want to search another form.

2. After a FindFirst, check NoMatch instead of EOF.

3. Your generic popup search form will also need to be told the name of the
field to search. Presumably you want it to search more than just an OrderID.

4. To build the FindFirst condition, you will need to include the correct
delimiter around the value to search. Dates need the hash delimiter (#), and
Text fields need the quote delimiter ("). It is not always easy to determine
the generic type required. BuildCriteria may help.

5. If you have heaps of forms all with the same thing (e.g. all searching
OrderID), it may be that you don't have a normalized structure (e.g. if you
used a different table for each client's orders). Correcting the data
structure is preferable to trying to build an interface to workaround the
problem. If this is not the case, then it's most likely that the user will
be searching for very different things in different forms. My preference is
to provide a few search/filter boxes in the Form Header of each form. The
user can search on the most common fields specific to that form.
 
Back
Top