Single report from continuous form

  • Thread starter Thread starter SusanV
  • Start date Start date
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
 
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
 
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
 
Back
Top