Series or choose and pick

  • Thread starter Thread starter Ron
  • Start date Start date
R

Ron

I have a query with the following criteria:
=[CTID of First Label to Print] And <=[CTID of Last
Label to Print]

Because she told me she wanted to be able to pull them up
in series (such as # 1-100).

Now she is asking how she can get just 2 or 3 to show
up. So for instance #1, #44, #99 (without all the
others).

I'm not making a new query/report. Is there any way to
make the current code choose and pick?

Thanks in advance..RT
 
Hi Ron.

What you are after is something like the File | Print dialog in Microsoft
Word, where you can type that you want to print pages:
1-3, 7, 12

To achieve that, you will need to write some code to parse the entry and
convert it into:
[CTID] IN (1,2,3,7,12)

Steps:
1. Use Split() to parse the entry into an array variant. (Assumes A2000 or
later.)
2. Loop through the array from lbound to ubound.
3. If the array entry is a range, then loop from the lower value to the
higher value.
4. Verify the results are valid numbers.
5. Concatenate the numbers into the string, separated by commas.
6. Use the string in the WhereCondition of the OpenReport action.

You can then remove the criteria in the criteria.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Ron said:
I have a query with the following criteria:
=[CTID of First Label to Print] And <=[CTID of Last
Label to Print]

Because she told me she wanted to be able to pull them up
in series (such as # 1-100).

Now she is asking how she can get just 2 or 3 to show
up. So for instance #1, #44, #99 (without all the
others).

I'm not making a new query/report. Is there any way to
make the current code choose and pick?

Thanks in advance..RT
 
Back
Top