Single report from continuous form

S

SusanV

Search function returns records in a continuous form. I'd like to be able to
open the associated report and print ONLY the report for the record which is
current in the form.

Probably incredibly simple but I'm just not seeing it...


Susan
 
R

Rick B

Here is some code I use to do what you are asking...



Private Sub Print_Button_Click()

If (IsNull([UserID])) Then

' Verify the key field (UserID) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[UserID] =
Forms![frmSomeFormName]![UserID]"

End Sub




Rick B
 
S

SusanV

Thanks Rick, that was exactly what I needed. I had done this previously but
couldn't remember.

Thanks tons!

Susan

Rick B said:
Here is some code I use to do what you are asking...



Private Sub Print_Button_Click()

If (IsNull([UserID])) Then

' Verify the key field (UserID) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[UserID] =
Forms![frmSomeFormName]![UserID]"

End Sub




Rick B

SusanV said:
Search function returns records in a continuous form. I'd like to be able to
open the associated report and print ONLY the report for the record which is
current in the form.

Probably incredibly simple but I'm just not seeing it...


Susan
 

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