Full Version: Most Unanswered Question at UA..
UtterAccess Forums > Microsoft® Access > Access Forms
Larry Larsen
I did my searching but nothing..
uestions: How do I requery/refresh/repaint/redraw.. my MSGraph.Chart.8(OLEUnbound0) chart..
My graph is on a form that's a subform on my main form
I have a temporary table which I write (4) records(max) to, this action is the result of moving up/down a listbox.
On my form I have a basic(as above) graph which is sourced by the table.
So as I move through the listbox(this listbox is a parameter for Insert query/sql statement) I re-write the data and want/need to update the graph..
But how..????
Note: As I looked through both UA & others it does seem to be a question that has few answers..
(good title should pull them in..)
Much appreciated if you could steer me to finding the right instruction..
Doug Steele
Assuming that the list box is on the main form, it should be something like:
I am not following your comments above clearly Larry. Can you explain a bit more in regard to the above line.

From what i gathered is that you are trying to pass values to the graph object dynamically and you want to know how to update the new values to immediately...... am i correct?

If that is the case then i would say after your update (i.e include new graph values) then call the procedure that houses your graph code.
Your procedure would be:

Private Sub MyProcedureName()
[color="green"] The code for your Graph goes here [/color]
End Sub

After your update of new values then call the above procedure.
Call MyProcedureName

Of course i have tried to answer your question without a clear understanding your requirements as i pointed to at the beginning of this post.

PS: I would be good to also see the code you are using.

Can you post your example database?
Larry Larsen
Ok.. Guy's
Ocan only show code and images..
Here's my image of the form:

I have a control that emulates the month #'s(middle listbox)..
In the click event of the listbox I do a number of small process..(that effect the graph..bottom right one)
Call fDeleteTmpTabledata
Call fUpdateContainerMonthly
Me.subfrmMonth!OLEUnbound0.Requery [color="red"]..Here is were I should be able to requery the graph..[/color]

Private Function fUpdateContainerMonthly()
Dim mysql As String
mysql = "INSERT INTO tmptblContMonthly ( Volume, MonthID, ClientName )"
mysql = mysql & " SELECT QryYearGraph.[CountOfContainer ID], QryYearGraph.MonthCnt, QryYearGraph.ClientName"
mysql = mysql & " FROM QryYearGraph"
mysql = mysql & " WHERE QryYearGraph.MonthCnt ='" & [Forms]![frmCurrentMonth]![txtCurMonth] & "'"
CurrentDb.Execute mysql, dbFailOnError ' DAO Based..
End Function
Private Function fDeleteTmpTabledata()
Dim mysql As String
mysql = "Delete * From tmptblContMonthly"
CurrentDb.Execute mysql, dbFailOnError ' DAO Based..
End Function

I hope the above will give you a some idea..
With the above instruction I'm asked to save the current field before the requery..?
The form is not bound and is simply a mixture of sourced controls..
Hey Larry, what about the the code specific to your graphs? How are you passing the data to your graphs to display the relevant info.
Larry Larsen
Hi Dane
I'm using the sql to delete and append new values as I change/move through the listbox..
So if I can refresh/requery the graph each movement will reflect the data in the table.
Larry -
on't know if you ever got an answer to this, but the following worked for me:
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.