Getting a value from a textbox on a report (1 Viewer)

fat controller

Slightly round the bend..
Local time
Today, 10:35
Joined
Apr 14, 2011
Messages
758
I have a few different reports that open depending on which is chosen by the user - the user selects their chosen report name which then is passed forward to a small form via OpenArgs, they then choose which record(s) ahould be in their selected report and the report runs.

All of the reports have a common field (AddFileName), and I am trying to see if there is a way to pick up the value from that field to use it in a string which makes up the filename for the report which is exported as PDF.

The problem I am having is that the report name is a variable, so the [Reports]!{MyReportName]![txtAddFileName] won't work, because the 'MyFileName' bit is a variable.

Is there a way around this?
 

Minty

AWF VIP
Local time
Today, 10:35
Joined
Jul 26, 2013
Messages
10,372
Assuming the report is open on you could use Screen.ActiveReport property, from MSDN;

Dim rptCurrentReport As Report
Set rptCurrentReport = Screen.ActiveReport
MsgBox "Current report is " & rptCurrentReport.Name
 

Users who are viewing this thread

Top Bottom