Between...And aka Rock and a Hard Place

G

Gdub

I have a form that batches products by last name, based
upon ranges selected by the user: i.e., A-G, H-M, N-S and
T-Z. The Form Fields are Range1, Range2 and a hidden
Range2a. When the customer selects the A-G button, it
pops in "A" in Range1 and "G" into Range2. The hidden
Range2a becomes "H". My query that returns the customer
data has a criteria under last name like so: Between
[Forms]![JMultBatcher]![Range1] And [Forms]![JMultBatcher]!
[Range2A]. It returns all customers between A-G, the
desired result.
However, when there are customers who happen to have a
last name starting with "Z", I have no higher range to
reference. I'm sure there is a better overall way to do
this, hence my plea. Many thanks in advance.
 
J

John Vinson

I have a form that batches products by last name, based
upon ranges selected by the user: i.e., A-G, H-M, N-S and
T-Z. The Form Fields are Range1, Range2 and a hidden
Range2a. When the customer selects the A-G button, it
pops in "A" in Range1 and "G" into Range2. The hidden
Range2a becomes "H". My query that returns the customer
data has a criteria under last name like so: Between
[Forms]![JMultBatcher]![Range1] And [Forms]![JMultBatcher]!
[Range2A]. It returns all customers between A-G, the
desired result.
However, when there are customers who happen to have a
last name starting with "Z", I have no higher range to
reference. I'm sure there is a better overall way to do
this, hence my plea. Many thanks in advance.

I'd set Range2a to Range2 & "{" - the left curly bracket character
comes right after "z" in the sorting sequence, so this will give you

BETWEEN "T" AND "Z{", which will pick up everything up through ZZZZZZ.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top