Can anyone help with me please - been scratching my head for over a week now
- I am trying to colour stacked bar charts dependant on a set of different
variables using the series collection property struggling to work out why I
continually get
Runtime Error '1004'
Unable to get the SeriesCollection property of the chart class
although when I select Debug and F5 the code runs and the chart is displayed
as expected.
I am using a number of case statements to select the colours an extract of
which is below
With rstAllTimes
With Forms!SearchForm.Graph27
Select Case rstAllTimes.Fields("Status")
Case Is = "Working"
.SeriesCollection(i).Border.Color = vbBlack
.SeriesCollection(i).Interior.Color = 26367
'MsgBox "CL04 Colour orange"
Case Is = "Break"
.SeriesCollection(i).Border.Color = vbBlack
.SeriesCollection(i).Interior.Color = vbBlack
many thanks for your post
However this does not resolve the issue (I apologise I had initilised i
before the start of the code segment I posted.)
I am still trying to get this to work however it may be better that I
explain a bit further.
I have a Form that contains a graph that is based on employee work times
I enter a Pay Number and the graph is then populated following a button
press from tables that sit behind this.
The problem appears to be happening when I update from one employee to
another where there is more in the subsequent series. ie the first employee I
select maybe has 6 events. If I enter a new employee who has more than six
events then I get the error
Unable to get the SeriesCollection property of the chart class
this does not happen when I go to an employee with less in the series ??
Still very Puzzled and any help would be much appreciated
Once again thanks for your time ... this still is not working for me still
getting the errors described previously
It appears the series collection count is not being updated despite the
rowsource and variable paynumber being changed ??
Once again many thanks for all your assistance
I hqve tried the debug.print and various permutations of your ideas. It
appears that the rowsource is not being updated quick enough for the
sub-routine and thereforce causing the error.
The routione etc works fine when I step through with F8, however when run in
its entirety it fails. I have managed to inroduce a 0.2 second wait which
allows the rowsource to be fully updated and provides the desired output.