How can I print on a report(label), the label number and total number of labels printed.<br>ie. Label 1 of 7<br> Label 2 of 7<br><br>
Ok a couple of things<br>Create a function like so:<br>--------------------<br>Public Static Function LabelCounter() As String<br> Dim Counter1 As Integer<br> Dim db As Database, rst As Recordset, SQL As String<br> Set db = CurrentDb<br> SQL = "Select * from [yourTable] Where 'something equals the aount of labels'"<br> Set rst = db.OpenRecordset(SQL)<br> rst.MoveLast<br> If RanOnce = True Then<br> Counter1 = 1<br> RanOnce = False<br> Else<br> Counter1 = Counter1 + 1<br> End If<br> <br> LabelCounter = "Label " & Counter1 & " of " & rst.RecordCount<br> <br> rst.Close<br> db.Close<br> <br>End Function<br>--------------------------<br><br>2. Put the Variable "RanOnce" in the Declarations of the module like this: (under the other items listed there)<br>Global RanOnce<br><br>3. Add a Text box to your label and put this in its Control Source: =LabelCounter()<br>4. Put the RanOnce variable in the On_Activate Event of the report like this<br>Private Sub Report_Activate()<br> RanOnce = True<br>End Sub<br><br>5. you need to have an SQL statement that returns the same number of labels that are printed<br>Using Recordsetclone does not work for a report unfortunately.<br><br>OK have fun<br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
I don't think I gave you enough info. I'm trying to print one label multiple times, and have the LABEL * OF * printed on each identical label.<br><br>Thanks in advance.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.