PRINT CURRENT RECORD from Form

Post a 97ver of your db here
 
I don't have an Access 97.
I am sorry.
But that db is just a table with 2 fields and a form.
Can you make it up?
Thanks.
 
You have the option to save a copy as a previous version
 
IT WAS PERFECT. THANKS A LOT.

NOW, I tried to send this current record to Outlook by a Word doc attachment, but my code doesn't work. Can you please help me this time?

Private Sub Command93_Click()
On Error GoTo Err_Command93_Click

Dim stDocName As String

stDocName = "rptA"

DoCmd.SendObject acReport, stDocName, acFormatSNP, stDocName, , , "Subject Line", , False

Exit_Command93_Click:
Exit Sub
Err_Command93_Click:
MsgBox Err.Description
Resume Exit_Command93_Click
End Sub
 
Code:
Private Sub Command93_Click()
On Error GoTo Err_Command93_Click

    Dim stDocName As String

    stDocName = "rptA"
    DoCmd.OpenReport stDocName, acViewPreview, , "[EmpID] = " & Me.EmpID & ""
    DoCmd.SendObject acSendReport stDocName, "RichTextFormat(*.rtf)", "Someone@Somewhere.com", "Cc", "Bcc", "Subject", "Message", True

Exit_Command93_Click:
Exit Sub

Err_Command93_Click:
Err.Clear
Resume Exit_Command93_Click
End Sub
 
Last edited:
Can you modify the code so that when click on it, it open an outlook , then you can enter any email address you want to send?

Thanks.
 
Code:
DoCmd.SendObject acSendReport, stDocName, "RichTextFormat(*.rtf)", , , , "Subject", "Message", True
 
Woh Woh Woh....
It Worked Perfectly.
___ Is This Your Name?
Thanks.
Jenny.
 
I adjusted the margins so that the form would fit to one page then just select to print the first page only. Worked for me. Mission accomplished.
 
Code:
Private Sub Command93_Click()
On Error GoTo Err_Command93_Click

    Dim stDocName As String

    stDocName = "rptA"
    DoCmd.OpenReport stDocName, acViewPreview, , "[EmpID] = " & Me.EmpID & ""
    DoCmd.SendObject acSendReport stDocName, "RichTextFormat(*.rtf)", "Someone@Somewhere.com", "Cc", "Bcc", "Subject", "Message", True

Exit_Command93_Click:
Exit Sub

Err_Command93_Click:
Err.Clear
Resume Exit_Command93_Click
End Sub



Code:
Private Sub CmdPrintCurrent_Click()
On Error GoTo Err_Link

StrCriterion = "[ID]=" & Me![ID]

If Me.Dirty Then
 Me.Dirty = False
  End If

DoCmd.OpenReport "YourReportName", acPreview, , StrCriterion

Exit_Link:
  Exit Sub

Err_Link:
    If Err = 3075 Then
     MsgBox "No Record Found, Please Add a New Record.", , "Oops!"
      Resume Exit_Link
     Else
         MsgBox Err.Description
            Resume Exit_Link
End If

End Sub

I use a similar method to yours. With a bit of error handling. I also save the record before printing the report to make sure the current record is up to date.
 

Users who are viewing this thread

Back
Top Bottom