Results 1 to 2 of 2
  1. #1
    adi2011 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    19

    Creating labels report with 'TimesToRepeatRecord' criteria

    Hi,

    in my database (db) I have first create simple report which can print label for certain article in number of times user wants to. That part of db is marked as OldLabels in db that I have attached below.

    Now, I plan to update this code via form NewLabels so user could choose more than one article and for each article he can define 'TimesToRepeatRecord' number. Unfortunately, I am little confused how to achieve this. This is the old code (from Report) which have done most of the work.

    Code:
    Option Explicit
            Dim intPrintCounter As Integer
            Dim intNumberRepeats As Integer
    
    Private Sub Report_Open(Cancel As Integer)
               intPrintCounter = 1
               intNumberRepeats = Forms!VPDEKLARACIJE!TimesToRepeatRecord
    End Sub
    
    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
    I have also attached db named "Demo" so you could see the issue.

    http://www.speedyshare.com/E2yq4/Demo.rar

    Many thanks in advance for your suggestions!


    Adi

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 10-01-2014, 07:51 AM
  2. Replies: 2
    Last Post: 05-09-2011, 06:45 PM
  3. Replies: 1
    Last Post: 03-20-2011, 09:21 AM
  4. trouble creating correct criteria
    By pshawk in forum Queries
    Replies: 1
    Last Post: 02-12-2010, 01:52 AM
  5. Creating a list viewed by 2 criteria
    By phillyon in forum Queries
    Replies: 0
    Last Post: 12-01-2008, 11:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums