Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to go to a record that starts with a certain letter

Status
Not open for further replies.

RandDUser

Technical User
Feb 24, 2005
65
0
0
US
I have a query that has about 500 names in it. The query is sorted in ascending order based off of last name.

I have a form based off of that query. The form is a continuous form.

In the form header, I have 26 labels for each letter of the alphabet, so that if I click on 'F', I want it to take me to the first record who's last name starts with an 'F' (again, it's in alpabetical order).

I've tried a few things with the GoToRecord command, but have had no luck. I would think this is an easy task to do, but I'm stuck. Any suggestions?

TIA.
 
A starting point:
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[last name field] Like 'F*'"
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top