Results 1 to 5 of 5
  1. #1
    Alex Motilal is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2008
    Location
    Coimbatore, India
    Posts
    182

    Printing Invoices

    Hi everybody,
    In my Orders MS Access Database, I print Invoices each 3 copies. Is it possible to create an unbound control, which should read for the first copy as "ORIGINAL", for the second copy as "FOR TAX DEPARTMENT" and for the third copy as "COPY FOR FILE" ?
    I think there should be some code on the Print Event of the Report.


    Thanks in advance.

  2. #2
    ansentry's Avatar
    ansentry is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2009
    Location
    Melbourne, Australia
    Posts
    67
    Have a look at the attached sample.

    It is not set out correctly for an "Invoice" but will give you code that you can use in your database.

    You will see that it will only print the "Current" record showing on the form.

    It will not allow you to print a blank "Invoice"

    I have used Open Arguments (OpenArgs) to make it work.

    Make sure you change then "names" to suit your database.

  3. #3
    Join Date
    May 2010
    Posts
    339

    Untested air code

    Alex,
    Here is my down and dirty solution.

    Create a report named rptOriginalCopy, place a label in the header that reads Original Copy.
    Copy and paste a second version of the same report and rename it rptTaxCopy change its label to Tax Copy.
    Copy and paste a third version of the same report and rename it rptFileCopy change its label to File Copy.

    This code prints 3 copies of the current record(s)
    strWhere = "[YourID] = " & Me.[YourID] this is where your primary key ID goes
    Next create a command button and cancel the wizard, in the 'on click' event place this code:

    Code:
    Dim strWhere As String
    If Me.Dirty Then 'Save any edits.
    Me.Dirty = False
    End If
    If Me.NewRecord Then 'Check there is a record to print
    MsgBox "Select a record to print"
    Else
    strWhere = "[YourID] = " & Me.[YourID]
    DoCmd.OpenReport "rptOriginalCopy", acViewNormal, , strWhere 'Prints Oringinal Copy
    DoCmd.OpenReport "rptTaxCopy", acViewNormal, , strWhere 'Prints Tax Copy
    DoCmd.OpenReport "rptFileCopy", acViewNormal, , strWhere 'Prints File copy 
     
    End If
    Just tweak it to fit your App
    -Richard-

  4. #4
    Alex Motilal is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2008
    Location
    Coimbatore, India
    Posts
    182

    Printing Invoices

    Thank you both John and Richard.

    The solution works fine.

    Alex

  5. #5
    ansentry's Avatar
    ansentry is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2009
    Location
    Melbourne, Australia
    Posts
    67
    Glad to help, good luck with you project.

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

Similar Threads

  1. Printing Form
    By linjoye in forum Reports
    Replies: 1
    Last Post: 02-19-2010, 08:09 PM
  2. Report Printing
    By newtoAccess in forum Reports
    Replies: 5
    Last Post: 12-02-2009, 07:46 PM
  3. Non-Printing Buttons?
    By Karend440 in forum Access
    Replies: 5
    Last Post: 11-30-2009, 08:03 AM
  4. Help with my printing
    By mattwill2001 in forum Queries
    Replies: 4
    Last Post: 08-17-2009, 01:55 AM
  5. Printing Reports....
    By Danny Christie in forum Reports
    Replies: 1
    Last Post: 12-06-2006, 05:51 PM

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 - Senior Forums