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

How do I create a cmdbutton to filter records? 1

Status
Not open for further replies.

Taecca

Technical User
Jul 20, 2004
59
US
I have created a form (continuous) and StudentName, StudentCity, StudentID are some of the columns.

I wish to add a button at the side of a column that when clicked will filter by the value (StudentID) on the current record.


How do I do it?

Thank you and happy new year



 
Try

Create the button

In the OnCLick Event of the Button put code so

Me.Filter = "StudentId = " & Me.StudentId
Me.FilterOn = True
Me.Requery

This is assuming StudentId is a Number, otherwise

Me.Filter = "StudentId = '" & Me.StudentId & "'"
Me.FilterOn = True
Me.Requery



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top