get a value when a report is open (1 Viewer)

jamest85

Registered User.
Local time
Today, 12:44
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
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:44
Joined
Aug 30, 2003
Messages
36,140
Yes, it's too early. Try in the format event of the section containing that control.
 

SOS

Registered Lunatic
Local time
Today, 12:44
Joined
Aug 27, 2008
Messages
3,514
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

Top Bottom