Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Labels (Access 2000)

    I have the following code create 4 labels on a page. I would like the last two labels on the page to be different. I would like one to have Ltd. Qty. and the other have a static address. I this possible.

    Thanks.

    Option Explicit
    Dim intPrintCounter As Integer
    Dim intNumberRepeats As Integer

    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    ' Note: intNumberRepeats and intPrintCounter are initialized
    ' in the report's OnOpen event.
    If intPrintCounter < intNumberRepeats Then
    intPrintCounter = intPrintCounter + 1
    ' Do not advance to the next record.
    Me.NextRecord = False
    Else
    ' Reset intPrintCounter and advance to next record.
    intPrintCounter = 1
    Me.NextRecord = True
    End If

    End Sub
    Private Sub Report_Open(Cancel As Integer)

    intPrintCounter = 1
    intNumberRepeats = 4

    End Sub

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Labels (Access 2000)

    Here is some code that will determine whether this label is different.

    I have not tried to work out what code to use in those blocks. One possibility is to set the visibility of different controls. You might have all the different variations on the label with most of the hidden. Then show the right ones at the right time.

    If intPrintCounter < intNumberRepeats Then
    intPrintCounter = intPrintCounter + 1
    ' Do not advance to the next record.
    if intPrintCounter = intNumberRepeats -1 then
    ' this is the last label so put her any code for that label
    elseif intPrintCounter = intNumberRepeats -2 then
    ' this is the second last label so put her any code for that label
    end if
    Me.NextRecord = False
    Else
    ' Reset intPrintCounter and advance to next record.
    intPrintCounter = 1
    Me.NextRecord = True
    End If
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •