Printing single record from a form

G

Grant

Greetings all,
I have a form that updates a database with information
for a apprasial. I would like the user to be able to just print a single
record ( the current record on the screen ) what would be the best way to do
this ?

Thanks in advance

Grant
 
J

Jim Kennedy

Add a command button with some code similar to mine
below. The stFilter variable is what limits the report to
the current record. You will have to use whatever the id
field is between the form and report.

Private Sub cmdPreview_Click()
On Error GoTo Err_cmdPreview_Click

Dim stDocName As String
Dim stFilter as String

stDocName = "rptCAR_PAR"
stFilter = "Action_Number ='" & Me.Action_Number & "'"

DoCmd.OpenReport stDocName, acPreview, , stFilter

Exit_cmdPreview_Click:
Exit Sub

Err_cmdPreview_Click:
MsgBox Err.Description
Resume Exit_cmdPreview_Click

End Sub
 
B

Brian

and if you want to get really really snazzy, you can create
your own menu bar w/ your very own "File" dropdown. Assign
the print command from their to a print macro that prints
off the report (that's what I just did for my program).
 
A

Albert D. Kallal

In addition to all these good suggestions, you need to write the current
record to disk.


so:

Dim stDocName As String
Dim stFilter as String

me.Refresh
stDocName = "rptCAR_PAR"
stFilter = "Action_Number ='" & Me.Action_Number & "'"

DoCmd.OpenReport stDocName, acPreview, , stFilter
 
K

Kieran

make a report on the table that the data is stored

then

on a command button on you apprasial form type somthing like
DoCmd.OpenReports "report name", , , "[employee number] = forms![apprasial
form].form![employee number]"
 
M

Mike Painter

Kieran said:
make a report on the table that the data is stored

then

on a command button on you apprasial form type somthing like
DoCmd.OpenReports "report name", , , "[employee number] = forms![apprasial
form].form![employee number]"

Close. Assuming employee number is a number and not text.
"[employee number] = " & forms![apprasial form].form![employee number]

or
"[employee number] = " & Me!employee number]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top