Printing current record in form

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
 
J

Jim Allensworth

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
 
R

Rick B

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
 

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