How Can I Test For Page Number
I am trying to test for the page number and I cannot seem to use my formula in an If..Then..Else.
I have a datasource called PageNum that works. When I preview my labels that field correctly displays the page number.
I created the following:
If Format.NamedSubStrings("PageNum").Value = "1" Then
Value = "Page 1"
Else
Value = "Not Page 1"
End If
If I test for string length It looks like the string is 3 characters wide ( I am only printing 4 labels so I would expect this number to be 1). I tried adding vbCrLf to the end of my "1" however the If..Then..Else always returns false.
One factor here to consider is that I am using a formula to calculate the number of pages to print based on a quantity field in the DB.
Aaaaaaaaarg - I must be doing something stupid here - any help greatly appreciated.
Thanks,
Dave Oender - 6541-246-3281
-
I changed to use Format.Object("PageNum").Value and now the If..Then..Else works.
0 -
Sorry I was too quick. It appears that the logic only works on the first record. So Testing for page 1 works. However testing for the last page does not.
When I look at the ASC string for all pages other than one I am getting 636363. I really only need to look for the first or last page so I can make this work.
But I would rather understand why this is happening and what if I wanted to test for the last page? How could I do that?
Sorry this one is not solved quite yet.
DaveO
0 -
Make sure your VBS is running in an event controlled VB script using the OnSerialize or OnIdenticalCopies event.
0
Please sign in to leave a comment.
Comments
3 comments