Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Print Direct (2003)

    How do I print a report from a form for the current record open. At the moment a button is pressed, and a query will ask for the Serial number. I have been asked for it print the current record.

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

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

    Re: Print Direct (2003)

    Does the record source of the form have a field that uniquely identifies the record? Let's say it is named ID and that it is a number field.
    You can then use code like this:

    Private Sub cmdReport_Click()
    DoCmd.OpenReport ReportName:="rptMyReport", WhereCondition:="ID=" & Me.ID
    End Sub

    If the ID field is a text field, change the above to

    ..., WhereCondition:="ID=" & Chr(34) & Me.ID & Chr(34)

    and if it is a date field, to

    ..., WhereCondition:="ID=#" & Format(Me.ID, "mm/dd/yyyy") & "#"

Posting Permissions

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