Help using "between"

jbphoenix

Registered User.
Local time
Today, 11:42
Joined
Jan 25, 2007
Messages
98
My query needs to pull data within a range of part numbers.

Here is what I have in the query -

On my form
Text21: 10360041
Text25: 10360064

Field: Part_ID
Table: SalesByPartCust
Criteria: Between [Text21] and [Text25]

When I run the query no data is returned. I did some other querying and found out it's because there is no data for part 10360064. Why won't the query pull up the other part data?
 
try

Between Forms!FormName.Text21 and Forms!FormName.Text25
 
I tried that and still nothing. I also tried between forms!SalesPartCust.Text21 and <= Forms!SalesPartCust.Text25. and I still get no results.
 
are you perhaps comparing a string to an integer?

Maybe try
Between CInt(Forms!FormName.Text21) and CInt(Forms!FormName.Text25)

or conversely
Between CStr(Forms!FormName.Text21) and CStr(Forms!FormName.Text25)
 
And if you take out that criteria, it returns records that falls between those 2 values? Is that a numeric field or text? You say you're opening a query; make sure you've tabbed off the form controls, or the value won't actually be available to the query.
 

Users who are viewing this thread

Back
Top Bottom