N
NevilleT
This should be very simple but a few hours later ... well you know how it is.
I have a form which has a Gantt chart. I want to produce a printed version
so created a report. The Gantt chart can be sorted by sequence number, start
or finish date. You select the sort order using an option group on the form.
What I want to do is to change the report rowsource when the report opens to
use one of three query sorted in one of three ways - sequence, start or end.
I can do it manually and it works. I enter a different query as the
rowsource of the unbound object and it displays just as it should. When I
try to do it using code it fails telling me
"You entered an expression that has an invalid reference to the property
rowsource."
The code is:
Private Sub Report_Open(Cancel As Integer)
Select Case Forms!frmGanttChart.opgSortBy
Case Is = 1
Me.oleGraph.RowSource = "qryGanttGraphSeqOrder"
Case Is = 2
Me.oleGraph.RowSource = "qryGanttGraphStartOrder"
Case Is = 3
Me.oleGraph.RowSource = "qryGanttGraphFinishOrder"
End Select
End Sub
I have a form which has a Gantt chart. I want to produce a printed version
so created a report. The Gantt chart can be sorted by sequence number, start
or finish date. You select the sort order using an option group on the form.
What I want to do is to change the report rowsource when the report opens to
use one of three query sorted in one of three ways - sequence, start or end.
I can do it manually and it works. I enter a different query as the
rowsource of the unbound object and it displays just as it should. When I
try to do it using code it fails telling me
"You entered an expression that has an invalid reference to the property
rowsource."
The code is:
Private Sub Report_Open(Cancel As Integer)
Select Case Forms!frmGanttChart.opgSortBy
Case Is = 1
Me.oleGraph.RowSource = "qryGanttGraphSeqOrder"
Case Is = 2
Me.oleGraph.RowSource = "qryGanttGraphStartOrder"
Case Is = 3
Me.oleGraph.RowSource = "qryGanttGraphFinishOrder"
End Select
End Sub