Graph not showing

A

Alejandro

Hello there,

I have a form with a couple of combo boxes and a OLE object (Microsoft Graph
Chart); the graph is supposed to show some average times when I click on the
CALCULATE button. The query that generates the graph uses another query as a
source (first query manipulates data from a table and the query in the graph
groups it by one category an filters based on the values from the combo boxes)

This is the code behind the CALCULATE button:

Private Sub cmd_Calculate_Click()
' Me.Requery
Me.grph_WaitTimeHistogram_ByPeriod.Visible = True
Me.grph_WaitTimeHistogram_ByPeriod.Requery
End Sub

After clicking on the CALCULATE button the graph is not generated; all I see
is a empty box. If I double-click on the box (which enables the Excel
features of the graph) then I see the graph. I tried adding Me.requery in my
code to see if by refreshing the whole form I'd get something different, but
it didn't work. I don't know if the problem is that I'm creating a graph
using a query whose source is another query, if I'm missing lines of code
that I should be using when working with graphs, or what, but I really need
to get this fixed. Any tip or advice is greatly appreciated.

Thanks,

A.
 
A

Alejandro

Good morning,

Usually this forum is excellent when it comes to timely (and helpful) tips
and answers; I don't know if I haven't seen a reply to my question because
nobody has seen it yet, because it is too complicated, or because I wasn't
clear with the issue. In any case, I would really (really) appreciate if
someone said something in this regard. I have to deploy an application in a
few days and I'm stuck with the graphs.

Thanks in advance for your help

A.
 
D

dymondjack

I have no experience whatsoever with OLE objects, but if I had to take a
guess, it seems that for whatever reason the data that's supposed to be
supplied to the graph is not getting there or not being understood when it
does get there.

Have you verified that the SQL string you are using is returns valid data?
THat would be the first place I'd start. Is there some way other than this
control that you can moniter the SQL output to verify the information is
getting there? I don't know what kind of query it is, so I can't even begin
to suggest a way to do that. As far as nested queries go, there's no general
reason that I know not to do that, but you'll have to be extra careful in
making sure everything is coming out right when you do it.

Does this control have a recordsource/rowsource property? I'm assuming it
must, being that you are trying to put an SQL to it, so maybe you should try
explicitly setting this property on the command button click event before you
requery it.

Another thing to try would be giving the OLE object some 'dummy data' rather
than your actual SQL string, just to make sure that the object itself is
working correctly. Something along the same format as what your SQL should
be supplying, but driven off a temp table maybe? Something solid anyway, so
you know the data is getting there correctly. SQL can certainly be tricky
and difficult at times to debug. So if your graph works fine with some data
that may be more reliable than the SQL, you'll know the problem is elsewhere,
otherwise there's some issue with the OLE object itself.

Like I said, I don't really know anything about this stuff, but if I had to
troubleshoot it, those would be the first things I would try. At least once
you get through all that, you'll have a better idea of where the problem is,
report back and maybe someone else can help with whatever specifics.

gl


--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
 
A

Alejandro

Jack, I really appreciate that you took the time to respond to this post.
Unfortunately I've tried everything I could come up with without good
results. I even created a new file with only one table and one form with a
graph, and the table only consisted of two columns: group and number (groups
A, B, C, D, and E, with values 1, 2, 3, 4, and 5). Even with this simple
table when I loaded the form I saw the "white box" where the graph was
supposed to be. I takes for me to perform another action (such as going back
to the design view, or maximizing another applications that I had minimized
in my task bar) for the graph to show up.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top