Solved

Refreshing MSCharts

Posted on 1998-05-03
2
256 Views
Last Modified: 2008-02-01
After I load an MSchart with data, I try to refresh the chart with new data.  I get an error when I try to refresh it with new data -- "Run-time erro 1119" It says "object uninitialized or Invalid.  Can someone please help.  ThankYou
0
Comment
Question by:imarch
2 Comments
 
LVL 6

Expert Comment

by:clifABB
Comment Utility
See question Q.10050892
0
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 100 total points
Comment Utility
imarch,

Try the following code:

Private Sub Command1_Click()
 Dim CostArray(1 To 12, 1 To 8) As Integer
 Dim RowCount As Integer
 Dim ColumnCount As Integer

 RowCount = UBound(CostArray, 1)
 ColumnCount = UBound(CostArray, 2)
 MSChart1.RowCount = RowCount
 MSChart1.ColumnCount = ColumnCount
 For Row = 1 To RowCount
  For Column = 1 To ColumnCount
   MSChart1.Row = Row
   MSChart1.Column = Column
   MSChart1.Data = CostArray(Row, Column)
  Next
 Next
 
 If cmdShort = True Then
  MSChart1.Title = "SHORT TERM COST ANALYSIS"
 ElseIf cmdLong = True Then
  MSChart1.Title = "Long TERM COST ANALYSIS"
 ElseIf cmdVacation = True Then
  MSChart1.Title = "Vacation TERM COST ANALYSIS"
 End If
 
 MSChart1.DataGrid.RowLabel(1, 1) = "jan"
 MSChart1.DataGrid.RowLabel(2, 1) = "feb"
 MSChart1.DataGrid.RowLabel(3, 1) = "mar"
 MSChart1.DataGrid.RowLabel(4, 1) = "apr"
 MSChart1.DataGrid.RowLabel(5, 1) = "may"
 MSChart1.DataGrid.RowLabel(6, 1) = "jun"
 MSChart1.DataGrid.RowLabel(7, 1) = "jul"
 MSChart1.DataGrid.RowLabel(8, 1) = "aug"
 MSChart1.DataGrid.RowLabel(9, 1) = "sept"
 MSChart1.DataGrid.RowLabel(10, 1) = "oct"
 MSChart1.DataGrid.RowLabel(11, 1) = "nov"
 MSChart1.DataGrid.RowLabel(12, 1) = "dec"
 
 MSChart1.DataGrid.ColumnLabel(1, 1) = 1996
 MSChart1.DataGrid.ColumnLabel(2, 1) = 1997
 MSChart1.DataGrid.ColumnLabel(3, 1) = 1998
 MSChart1.DataGrid.ColumnLabel(4, 1) = 1999
 MSChart1.DataGrid.ColumnLabel(5, 1) = 2000
 MSChart1.DataGrid.ColumnLabel(6, 1) = 2001
 MSChart1.DataGrid.ColumnLabel(7, 1) = 2002
 MSChart1.DataGrid.ColumnLabel(8, 1) = 2003

 MSChart1.Legend.Location.Visible = True
End Sub


Best regards
Bin Huwairib
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now