rowsource is missing?

JMS

Registered User.
Local time
Today, 13:49
Joined
Aug 8, 2002
Messages
12
rowsource is missing?- strange error msg!!

I am attempting to use VBA to change the rowsource on a chart.

The code is like this:

Private Sub Report_Open(Cancel As Integer)

Me.[ChartOLEUnbound].[RowSource] = SQLCode

End Sub

I am 100% sure that the SQL code is correct and I have tested it in other queries.

The program complains that there is no such property as RowSource, but it does exist -- it can be easily modified through the property menu!

The error: Runtime error '2455' - You entered an expression that has an invalid reference to the property RowSource. The property may not exist or may not apply to the object your specified.

How do I use RowSource in VBA?
 
Last edited:
Try this:

Me.[ChartOLEUnbound].RowSource = SQLCode

The [] might be throwing Access Off.
 
Travis said:
Try this:

Me.[ChartOLEUnbound].RowSource = SQLCode

The [] might be throwing Access Off.


I've tried it both ways and it didn't work.

The syntax with the extra bracketing was actually generated by the expression builder when I tried to do it that way.
 
This is a stab in the dark, but did you try putting the code in Report_Load instead of Open?
 
doulostheou said:
This is a stab in the dark, but did you try putting the code in Report_Load instead of Open?

Unfortunately, report_load does not exist.

(Unlike forms, there is no corresponding function to form_load.)

Besides, in forms, the 'open' function executes before the 'load' function.
 

Users who are viewing this thread

Back
Top Bottom