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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup buttons... 4

Status
Not open for further replies.

amandarose80

Technical User
Jan 13, 2003
52
US
I have a form that is a list of names... I want to be able to have buttons at the bottom of the form ie (A-D), (E-G), etc. When the E-G button is clicked the cursor would go to the first record that begins with an 'E'. (the rest of the records after that would display under the 'E's, obviously.) Is there a way to set this up?
 
yes ther is a way
but it depends on how good you are in vba

"What a wonderfull world" - Louis armstrong
 
In the OnClick event of each button, call a function and pass it the letter. Like this:

OnClick... =FindName("E")

Function FindName(strLetter as string)

Me.RecordsetClone.FindFirst "name like '" & strLetter & "*'"
If (Not Me.RecordsetClone.NoMatch) then
Me.Recordset.Bookmark = Me.RecordsetClone.Bookmark
End if

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top