Build my own find and replace

  • Thread starter Thread starter JShrimps, Jr.
  • Start date Start date
J

JShrimps, Jr.

(Actually, just the Find part).
When I press <ctrl> "F", the built-in "Find" window opens.
I have a datasheet form with over a thousand records.

I'd like to have a do-it-yourself "Find" window with the
"Find what" combo box already populated with the names
of the clients. When the user selects the client, the cursor
should move to that client (either up or down the last-name
alpha sorted list). I don't want to filter this datasheet in any way -
all 1,000 records should allways appear at all times.

If there is another way to do this - by changing the client name
to a combo box, and updon selecting the client name, having the cursor
move to that client name - but NOT by filtering the datasheet,
that would work also.
 
JShrimps said:
(Actually, just the Find part).
When I press <ctrl> "F", the built-in "Find" window opens.
I have a datasheet form with over a thousand records.

I'd like to have a do-it-yourself "Find" window with the
"Find what" combo box already populated with the names
of the clients. When the user selects the client, the cursor
should move to that client (either up or down the last-name
alpha sorted list). I don't want to filter this datasheet in any way -
all 1,000 records should allways appear at all times.

If there is another way to do this - by changing the client name
to a combo box, and updon selecting the client name, having the cursor
move to that client name - but NOT by filtering the datasheet,
that would work also.

I don't like using datasheet view for this kind of thing
because it doesn't have as many features as the other form
views and the logic of using multiple forms can get a little
convoluted. If you like the looks of datasheet view, you
can make a Continuous view form look like it's a datasheet,
but with the added features of being able to display the
form header and/or footer sections. This way you can use
either a combo box or text box control (let's say it's named
FindThis) in the form's Header section. You may (or may
not) run into a performance issue using a combo box with a
thousand items, but a combo box does add the autocomplete
capability.

Whether you use a combo or text box, use its AfterUpdate
event to run code like this:

If Not IsNull(Me.FindThis) Then
With Me.RecordsetClone
.FindFirst "LastName = """ & Me.FindThis & """"
If .NoMatch Then
Beep
Else
Me.Bookmark = .Bookmark
End If
End With
End If
 
Back
Top