By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,460 Members | 2,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,460 IT Pros & Developers. It's quick & easy.

Printing current record

P: n/a
Hi

Is there a way to print/e-mail the current record as it appears on a form?

Thanks

Regards
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
John,

Use printscreen to "print" a copy of the screen to the clipboard and open
paintbrush to paste it there. Then print it out from paintbrush.

herbert

"John" <Jo**@nospam.infovis.co.uk> bl
news:3f***********************@news.dial.pipex.com g...
Hi

Is there a way to print/e-mail the current record as it appears on a form?

Thanks

Regards

Nov 12 '05 #2

P: n/a
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:3f***********************@news.dial.pipex.com ...
Is there a way to print/e-mail the current record as it appears on a form?


To print the current record, create a report, and use the primary key value
in the WhereCondition of the OpenReport action. The Click event procedure
for a command button to print the current record would look like this
(assuming an Autonumber primary key named "ID":

Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select a record to print."
Else
strWhere = "[ID] = " & Me.ID
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub

To email, use SendObject.
SendObject does not have a WhereCondition.
Create a public variable by typing this into the General Declarations
section (top) of a standard module:
Public gstrReportFilter As String

Set the string before calling SendObject:
gstrReportFilter = Me.ID

In the Open event of the report, apply the filter so it contains only the
one record, and reset the string:

Private Sub Report_Open(Cancel As Integer)
If Len(gstrReportFilter) > 0 Then
Me.Filter = gstrReportFilter
Me.FilterOn = True
gstrReportFilter = vbNullString
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
Nov 12 '05 #3

P: n/a
You could filter the form to the record you are interested in then user
File/Print Preview or File Send and select the Access view format.

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:3f***********************@news.dial.pipex.com ...
Hi

Is there a way to print/e-mail the current record as it appears on a form?

Thanks

Regards

Nov 12 '05 #4

P: n/a

"Herbert Chan" <he*****@chan.com> wrote in message
news:bn*********@rain.i-cable.com...
John,

Use printscreen to "print" a copy of the screen to the clipboard and open
paintbrush to paste it there. Then print it out from paintbrush.


In Access XP at least, you can use the File, Print, Print Current Record
option.

Simeon
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.