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

Printing Mailing Labels starting at specified label 1

Status
Not open for further replies.

LRBFAN

Programmer
Jun 1, 2006
24
US
thread149-1421170

CR2008 Foxpro DB using ODBC

I've tried using lbass's suggestions from the above Thread on how to print mailing labels starting at a certain label, BUT so far I've had no success. It ALWAYS prints on the first label instead of the label I specify in the parameter.

I created a command with the following SQL:

Select Students.`lname`,
Students.`fname`,
Students.`address`,
Students.`city`,
Students.`state`,
Students.`zip`
From Students
Union All
Select Null,Null,Null,Null,Null,Null
From Students
Where {?Label_No} >= 0
Order by 1

Parameter is {?Label_No}, it's a number and the prompt text is: "Start printing on what label number?"

I have unchecked Suppress Bank Section in all Detail sections and entered the following in each of the associated X+2 boxes:

recordnumber >= {?Label_No}

I am sorting by Students.lname ascending.

As a test I added "isnull(Students.lname)" to the Record Selection Formula and I get ONE null label on label #1 even though ?Label_No = 6, but NO null labels when I don't have a Record Selection Formula.

Does that mean there is something wrong with the Select Null,Null,Null,Null,Null,Null in the SQL??

Any suggestions lbass? Much appreciated.
 
But your example contains no duplicates and appears to be working correctly.

-LB
 
I don't see why this would happen. I can't recreate it and can't run your report to test things. What happens if you remove the Order by clause?

-LB
 
BINGO.......that did it!! Not sure why this works but am happy and thankful to you that it does. I was about to suggest I send you a test table and link to the Foxpro ODBC so you could run the report yourself.

Thanks again and have a nice weekend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top