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

Apply a filter in VB

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
586
GB
I am just learning VB.

I have created a form that on opening gets it's conrol source set to a table depending on ID criteria. The form is therefore used to front data from many tables.

Each underlying table has the same format.

I want to be able to filter the data by the [money in] field and exclude any items that are below £100

Please could soemone give me the VB code for this. Many thanks
 
If you were running the code from a command button on the form:

Code:
Private Sub cmdApplyFilter_Click()
    Me.Filter = "[Money In] > 100"
    Me.FilterOn = True
End Sub

You may want to consider your database design as well. If you have multiple tables with the same structure then your database is not normalised properly. You'd probably be saving yourself a lot of hassle in the future by storing the data in a single table.

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top