Results 1 to 6 of 6
  1. #1
    gebmiller1984 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jan 2015
    Location
    Devon
    Posts
    22

    Single Invoice Printing

    Hi I have a db set up. I enter details for an invoice. Select Print Invoice and It will bring up a Report document with all details on.

    What It is doing now is when I select a customer from a combo box auto populate data. It prints all Invoices for that person. It originally
    did only print the current record. Is there any way in adding a code to the following so it only prints the current record on screen.

    Private Sub cmdPrintRecord_Click()
    Dim strReportName As String
    Dim strCriteria As String

    strReportName = "rptPrintRecord"
    strCriteria = "[CustomerName]='" & Me![CustomerName] & "'"
    If Me.Dirty Then Me.Dirty = False
    DoCmd.OpenReport strReportName, acViewPreview, , strCriteria



    End Sub


    Or can I add a tick box and a query so it only prints the specific record.What ever is easy would be the best

    Much appreciated

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Use record ID instead of customer name as criteria.

    Why did it used to print only current record? What was changed?
    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.

  3. #3
    gebmiller1984 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jan 2015
    Location
    Devon
    Posts
    22
    It wont allow me to change to CustomerID, It goes wrong. Is there a way of adding a code so it only prints the current record. It comes up with the following error when changing to CustomerID

    Data Type Mismatch in criteria expression.

    When I go into the coding the bottom line is highlighted in yellow

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Using CustomerID will still print all invoices for that customer. If you want only one invoice then need that ID.

    Assuming ID fields are number type, remove apostrophe delimiters.

    "InvoiceID = " & Me!InvoiceID
    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.

  5. #5
    gebmiller1984 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jan 2015
    Location
    Devon
    Posts
    22
    Done, thank you. It still prints out 4 pages though. one with data on two blank and a footer. Is there a way of setting these to only print one page.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Would have to know more about the report design. Maybe you just need to resize stuff.
    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. Printing a single form
    By BRZ-Ryan in forum Forms
    Replies: 1
    Last Post: 12-05-2013, 10:17 AM
  2. Replies: 9
    Last Post: 06-26-2013, 08:28 AM
  3. Replies: 1
    Last Post: 10-10-2012, 01:05 PM
  4. Invoice Help..Printing too many times
    By StarFinder in forum Reports
    Replies: 10
    Last Post: 02-04-2012, 01:38 AM
  5. Printing An Invoice
    By scotty123 in forum Forms
    Replies: 3
    Last Post: 09-22-2011, 04:35 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