Data sheet "jump to"

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

J. Shrimp, Jr.

I have a datasheet form with many records.

If some is reviewing the "Andy Adams" record,
and would the next record they'd like review is
"Zelda Zimmerman", they have to scroll all the way
down the datasheet.

If I turn the name field in the datasheet to a combo box
of all names in the table, and the user starts typing in the first name,
the combo box starts to display all the names with those
first letters.

Once the next name is selected, how is it possible for the
datasheet form to send/position the cursor to that name, and
then requery?

This is pretty much a ctr "F" search function, using a combo box
instead of typing in a name which may/may not be misspelled.
 
You can use the ComboBox wizard to build you a ComboBox to
navigate to records in your form as you are asking. It is
usually placed in the Header of the form. Not sure if this
will work with a DataSheet form as there is no Header. You
can set up a FormView form to look like a DataSheet form and
then it should work.

Gary Miller
Sisters, OR
 
Once the next name is selected, how is it possible for the
datasheet form to send/position the cursor to that name, and
then requery?

This is pretty much a ctr "F" search function, using a combo box
instead of typing in a name which may/may not be misspelled.

Place that datasheet form onto another form as a subform. On the main (other)
form, place a textbox. In the textbox's "OnChange" event procedure, use code
similar to the following:

'**********EXAMPLE START
If Len(Trim(Me.Text2.Text)) > 0 Then
'Filter using entered characters
Me.SubFormName.Form.Filter = "LastName like """ & Me.Text2.Text & "*"""
Else
'Remove filter
Me.SubFormName.Form.Filter = ""
End If

'If Filter is off, turn it on
If Not Me.SubFormName.Form.FilterOn Then
Me.SubFormName.Form.FilterOn = True
End If
'**********EXAMPLE END

Replace "SubFormName" with the name of the subform *control* on the main form,
not the name of the subform (although the two may share the same name).
Obviously, you will need to change all the control and field names to match
those in your project.
 
Back
Top