get a value when a report is open

jamest85

Registered User.
Local time
Today, 12:58
Joined
Jan 20, 2008
Messages
52
Hi:

I am trying to get a value when my report is open. (The report has a valid Record Source, and opens with valid data)

For example:
Private Sub Report_Open(Cancel As Integer)
Dim sName As String
sName = Me.CustomerName
End Sub

Why the Me.CustomerName is empty? Is it too early to get the value in the Open() Sub?

Thanks a lot.

JT
 
Yes, it's too early. Try in the format event of the section containing that control.
 
Or if you have Access 2007 you can use the LOAD event of the Report (which doesn't exist in previous versions).
 

Users who are viewing this thread

Back
Top Bottom