Printing single record from a form

  • Thread starter Thread starter Grant
  • Start date Start date
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
 
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
 
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).
 
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
 
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]"
 
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]
 
Back
Top