Results 1 to 6 of 6
  1. #1
    stattech is offline Novice
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Posts
    11

    Print Single Record

    I have attached a file showing a screen shot of my order entry form along with details of my command button.



    Upon hitting the Print Preview button I preview the invoice report for the selected invoice. I then hit print, select the appropriate printer and generally everything works as desired.

    However ocassionally rather than just the single record report, it spews out copies of the form for hundreds of records.

    Appreciate any words of wisdom!

  2. #2
    Join Date
    May 2010
    Posts
    339

    Print Single Record

    This will print the record you are currently looking at if that will help.


    http://allenbrowne.com/casu-15.html

  3. #3
    stattech is offline Novice
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Posts
    11
    I have editted the command button and 5% of the time I print the form rather than the report. Details of the button command:

    Private Sub cmdPrint_Click()
    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 = "[Inv] = " & Me.[Inv]
    DoCmd.OpenReport "Preprinted", acViewPreview, , strWhere
    End If
    End Sub
    Private Sub Option143_Click()
    End Sub


    Appreciate your help!

  4. #4
    Join Date
    May 2010
    Posts
    339
    Code:
    Private Sub cmdPrint_Click()
    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 = "[Inv] = " & Me.[Inv]
    DoCmd.OpenReport "Preprinted", acViewPreview, , strWhere
    End If
    End Sub
    Private Sub Option143_Click()
    End Sub
    Code:
    Private Sub cmdPrint_Click()
    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 = "[Inv] = " & Me.[Inv]
    DoCmd.OpenReport "Preprinted", acViewPreview, , strWhere
    End If
    End Sub
    Private Sub Option143_Click()
    End Sub
    Is inv a primary key? also the last two lines need to be removed.

  5. #5
    stattech is offline Novice
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Posts
    11
    Yes 'inv' is a promary.
    I've removed the l;ast two lines.

    Keep your fingers crossed.
    Appreciate your feedback!

  6. #6
    stattech is offline Novice
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Posts
    11

    Print Single Report

    I have attached screen shots of my A/P and A/R forms, as well as shots of two different approaches I’ve tried to print a single record report.
    Neither approach works 100% of the time – occasionally each button results in printing ALL records!

    Thanks for your help!

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

Similar Threads

  1. Replies: 5
    Last Post: 03-23-2011, 10:39 AM
  2. Print Single Envelope From Form
    By genest11 in forum Forms
    Replies: 2
    Last Post: 03-25-2010, 09:00 AM
  3. Print Single Report
    By emkwan in forum Access
    Replies: 1
    Last Post: 01-29-2010, 11:19 AM
  4. Single Record Reports (HELP)
    By bnckeye27 in forum Reports
    Replies: 1
    Last Post: 11-13-2009, 02:14 PM
  5. Adding a single record
    By kfoyil in forum Forms
    Replies: 2
    Last Post: 11-22-2006, 09:12 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