Printing current record in form

  • Thread starter Thread starter Hanksor
  • Start date Start date
H

Hanksor

I'm sure that there is a fairly "simple" solution to my problem but I am
apprently having a "brain fart" and can't figure it out. I want to print
the current record in a particular form to a report. Any help will be
appreciated.

hanksor
 
I'm sure that there is a fairly "simple" solution to my problem but I am
apprently having a "brain fart" and can't figure it out. I want to print
the current record in a particular form to a report. Any help will be
appreciated.

You need to supply the WHERE condition to the report when you open it.
Like...

DoCmd.OpenReport "rptReport",,,"UniqueID=" & Me.UniqueID

If your ID is text, surround it with single quotes ...
DoCmd.OpenReport "rptReport",,,"UniqueID='" & Me.UniqueID & "'"


- Jim
 
Do a search. This question is asked and answered allllll the time in these
groups.

You will need to create a button. The button should open a report. You
will have to tie in a statment to only pull the report for the current
record.

Here is a sample from my employee database...

-----------------------------------------------
Private Sub Print_Button_Click()
If (IsNull([UserID])) Then
' If no employee selected, stop procedure
Exit Sub
End If
DoCmd.OpenReport "Admin - Employee Worksheet", acViewNormal, "",
"[UserID]=Forms![frmSINEmpDataMaintenance]![UserID]"
End Sub
-----------------------------------------------


Do a search for more details.

Rick B



I'm sure that there is a fairly "simple" solution to my problem but I am
apprently having a "brain fart" and can't figure it out. I want to print
the current record in a particular form to a report. Any help will be
appreciated.

hanksor
 
Back
Top