Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print the record on screen (2000)

    Edited by HansV to provide link to post - see <!help=19>Help 19<!/help>

    I searched and found a post that I thought could do what I wanted. <post#=444125>post 444125</post#>. I want to print what is showing on the screen in a form - just the record that is showing. I used the following but it prints all the records not just the one on the screen.

    Private Sub cmdPrintForm_Click()
    On Error GoTo Err_Command14_Click

    Dim stDocName As String
    Dim MYForm As Form

    stDocName = "frmEPEntry"
    Set MYForm = Screen.ActiveForm
    DoCmd.SelectObject acForm, stDocName, True
    DoCmd.PrintOut
    DoCmd.SelectObject acForm, MYForm.Name, False

    Exit_Command14_Click:
    Exit Sub
    Err_Command14_Click:
    MsgBox Err.Description
    Resume Exit_Command14_Click

    End Sub

    Is there a way to print what is on the screen (in landscape preferably) by tweaking the code somehow?

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

    Re: Print the record on screen (2000)

    You shouldn't try to print a form. Design a report based on the same table/query as the form instead, and use a command button on the form to display/print the current record in the report. There are examples higher up in the same thread you referred to.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print the record on screen (2000)

    Did what you said and it works just fine using a report that I already had. Thanks for your help.

Posting Permissions

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