Max Kentwell
Max Kentwell

Reputation: 13

MS Access Continuous Form: How to filter records (standard number format) between the min and max range?

Here is my stocks table:

product_group dimension cost
TI 8x4 5000
WN 2000
YS 7x9 25000
ST 10x15 8000

I made a query stocksListQ and created a form findStocks based on that, adding a CostMinSearch (default = 0) and CostMaxSearch (default = 9,999,999) textboxes for the user to input value and query the table based on the range.

My current criteria for cost: Between [Forms]![findStocks]![CostMinSearch] And [Forms]![findStocks]![CostMaxSearch]

Currently, No matter what I type into CostMinSearch or CostMaxSearch, EVERY record will be displayed. How can I modify my cost criteria so that they will display the correct results showing the records inside the min and max range?

For example:

Upvotes: 0

Views: 31

Answers (1)

Gustav
Gustav

Reputation: 55981

First, for the query, specify [Forms]![findStocks]![CostMinSearch] And [Forms]![findStocks]![CostMaxSearch] as Parameters of data type Currency.

Next, include the values in the query while debugging to verify what values you actually pass, like:

MinCost: [Forms]![findStocks]![CostMinSearch]
MaxCost: [Forms]![findStocks]![CostMaxSearch]

Upvotes: 0

Related Questions