Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009

    Unanswered: Print record in a selection

    I have a subform within a subform. Subform1 filters down to a specific patient. Subform2 shows all the records. I added a command button in order to make printing a record easier, but it prints all records associated with the patient, instead of the current one on the screen. This is the command button code:

    Private Sub Print_Click()
    On Error GoTo Err_Print_Click

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

    Exit Sub

    MsgBox Err.Description
    Resume Exit_Print_Click

    End Sub

    How do I modify it to print just the record on the screen (other than just doing a Print Screen off the keyboard)?

    Thanks :-)
    Last edited by SRR; 02-23-10 at 13:45.

  2. #2
    Join Date
    May 2005
    Assuming you already have a form set-up that is nice to print a single record and this is where the button is, check out the rest of the arguments of the PrintOut method; you can specify the From-To print range.

    But I rarely like to print forms, I would rather setup a report that may look similar to the form, and then set either the filter or the recordsource of that report to only print the record(s) in question.
    Me.Geek = True

  3. #3
    Join Date
    Dec 2009
    Thanks, I will probably just stick to the report and remove the button. They've already asked for a bunch of other modifications, and at this point every time they have a "suggestion" I have to refrain from singing "you can't always get what you want..." LOL

Posting Permissions

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