Results 1 to 7 of 7
  • Thread Tools
  1. rlbroerman
    #1
    Guest

    Print single record (access 2003)

    I want to be able to print one record at a time on a report from a form.
    I tried a procedure from Microsoft Office Online "English Knowledge Base"
    ACC2000: How to Print a Single Record from a Form in a Report
    But it printed out all the records in the table that the form is looking at.
    Can you help?
    Rick Broerman

  2. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Print single record (access 2003)

    It would have been helpful if you had posted a link to the MSKB article, or at least its KB number, instead of letting us search for it.

    The instructions in ACC2000: How to Print a Single Record from a Form in a Report are clear and correct, so if you follow them, the report should only display/print a single record. Can you post the code for your command button?

  3. rlbroerman
    #3
    Guest

    Re: Print single record (access 2003)

    Private Sub cmdPrintRecord_Click()

    Dim strReportName As String
    Dim strCriteria As String

    strReportName = "LastName,Medicine,History"
    strCriteria = "[DeaconessID]='" & Me![DeaconessID] & "'"
    DoCmd.OpenReport strReportName, acViewPreview, , strCriteria

    End Sub

  4. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Print single record (access 2003)

    This code assumes that DeaconessID is a text field. Is that correct? If it is a number field, you should use
    <code>
    strCriteria = "[DeaconessID]=" & Me![DeaconessID]</code>

  5. rlbroerman
    #5
    Guest

    Re: Print single record (access 2003)

    This is a number field. I tried your suggestion and it still didn't work. Attached is part of my database.
    Thanks for the help.
    RickBroerman

  6. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Print single record (access 2003)

    DeaconessID is not a field in the record source of your report, so a filter on DeaconessID won't work. If you add DeaconessID (from the Demographics table) to the record source, it should work the way you want.

  7. rlbroerman
    #7
    Guest

    Re: Print single record (access 2003)

    Hans,
    It works great. Thanks for sticking with me.
    Rick Broerman

Posting Permissions

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