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

Filtering a subform

Status
Not open for further replies.
May 20, 2005
24
GB
I'm trying to apply a filter to a subform based on the entry given in an inpout box when you click a button. The subform says that it is filtered but all records are still visible!
This is the code on the button - can anyone advise please?
Many thanks :)

Criteria = InputBox("Enter Dealership")

[Forms]![FrmBrowser]![FrmBrowser subform].Form.Filter = [Forms]![FrmBrowser]![FrmBrowser subform]![Dealership] = Criteria

[Forms]![FrmBrowser]![FrmBrowser subform].Form.FilterOn = True
 
You may try this:
[Forms]![FrmBrowser]![FrmBrowser subform].Form.Filter = "Dealership='" & Criteria & "'"

Dealership should be the name of the field in the underlaying Table/Query.
If Dealership is defined as numeric then get rid of the single quotes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top