Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004

    Unanswered: Problems printing only the current record

    I am trying to make a command button to print the current record i am working on in a form. I followed to instruction in the Access help index to no avail. The instructions are as follows:

    1)Open the form in Design view.
    2)Click Control Wizards in the toolbox if it's not already pressed in.
    3)In the toolbox, click Command Button .
    4)On the form, click where you want to place the command button.
    5) In the first wizard dialog box, click Record Operations in the Categories box, and then click Print Record in the Actions box.

    It creates the button just fine but when I use the button it prints every record in the database instead of the current one.

    This is the code the wizard creates for the print button:

    Private Sub Print_Current_Click()
    On Error GoTo Err_Print_Current_Click

    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.PrintOut acSelection

    Exit Sub

    MsgBox Err.Description
    Resume Exit_Print_Current_Click

    End Sub

    I am still pretty new to Access so I might be missing something very simple.

    Thanks in advance

  2. #2
    Join Date
    Nov 2003
    Sussex, England


    A simple, if not elegant, approach to this might be to filter the form so that it only shows one record at a time. Keep the form you've got, but open if from another form which you use to search for a particular record, this should then open the form with only one record, which you can then print.

  3. #3
    Join Date
    Aug 2002
    Northampton, England
    That code should not be a problem. I have just tried it on my DB and it only prints one record. It shouldn't make any difference, but make sure you have a primary key set. I would delete the command button and create a new one. See if that does the trick.


  4. #4
    Join Date
    Feb 2004
    Thanks for the advice guys. I remade the the button and it is working fine now.

Posting Permissions

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