Programatically change label in Rpt Header with Where Conditions

J

Joe Bartnicki

I want the label in the Report Header to show the QUERY
and WHERE CONDITIONS that were applied to open the
report. I use a menu with a button to run a VB event
procedure that opens the report with:
Dim stDocName As String
Dim stQueryName As String
Dim stWhereName As String
stDocName = "MyReport"
stFilterName = "MyOPENSQuery"
stLinkCriteria = "[Owner]=" & "'" & Me![Search Owner]
& "'"

DoCmd.OpenReport stDocName, acPreview, stFilterName,
stLinkCriteria

I would like a label field in the Report Header to
read "Open Records with Owner = Fred"

Can anyone give me some sample code that can change label
fields within a report ?

Thank You
 
R

Rod

Set the control source to:
="Open Records with Owner = Fred; SQL=" & ([Forms]!
[YourFormName]![YourSQLString])

(or however you want to format it.)
 
D

Duane Hookom

Try create a text box with a control source of:
="Open Records with " & [Filter]
 

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