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

having buttons find a certain record based on first letter 2

Status
Not open for further replies.

alblunkproex

IS-IT--Management
Jun 25, 2008
18
US
Scenario:

I have a continuous form with a vendor list... alphabetized by the vendor name.. I want to create 5 buttons that put the list at the first letter in the button... so if the button L-P it would go to the first record taht starts with L.

Any ideas?
 
Have a look at the Northwind sample database phone book form.
 
i kinda get it, but how did they set the filter... VB doesnt like my quotation marks.
 
Either double these ", or one of these ':

"[Vendor's Name] Like 'A*' or 'B*' or 'C*'.....'E*'"

"[Vendor's Name] Like ""A*"" or ""B*"" or ""C*"".....""E*"""

Or

"[Vendor's Name] Like ""[A-E]*"""
 
alright well it liked that but its not doing anything with this code.

Private Sub A_E_Click()
Me.Form.Filter = "[Vendor's Name] Like ""A*"" or ""B*"" or ""C*"" or ""D*"" or ""E*"""
Me.Requery
End Sub
 
Code:
Me.Form.Filter = "[Vendor's Name] Like '[A-E]*'"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Skip the requery and add:

Me.FilterOn=True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top