variables within format function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following string in a textbox in the report header:

="Schedule Summary for " & Format(Now(),"dddd"", ""mmmm d"", ""yyyy")

Instead of useing the now function I have a global variable that is
populated before the report is run with a date. How do I get this string to
use the variable instead of now? I have tried the following and it asks for
a value for the variable

="Schedule Summary for " & Format(ReportDate,"dddd"", ""mmmm d"", ""yyyy")
 
You need a public function that returns the variable:

Public Function GetReportDate() as Date
GetReportDate = ReportDate
End Function

Then use:
="Schedule Summary for " & Format(GetReportDate(),"dddd"", ""mmmm d"",
""yyyy")
 
Back
Top