Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Report Values to a Public Function.

Status
Not open for further replies.

Sanibel

Technical User
Nov 15, 2001
73
GB
I currently use a module to pick up fields from a report, manipulate the fields and use the result to populate other fields within the report. If I include the module within the report it works fine.
I now wish to use the same module from other reports. I have included the code within a Module and declared it as a Public Function but am having difficulty obtaining the required fields from the reports. If I use Reports![ReportName].Field that will work for the current report named ReportName. How can I pick up the required fields for report names different from ReportName? Just using Me. gives a compiler error.

Thanks
 
Pass in a report name parameter of type string. You can then pass the data out by using an alternative syntax:

Reports(strReportname).Fields(strFieldname) = strValue

Me refers to the current class, of which a form or report is one particular type. This is why you can't use it within your report function.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top