Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded Graph based on VB code 1

Status
Not open for further replies.

ca268339

Programmer
Aug 7, 2000
32
US
This question has been asked before without any answer. Has anyone been able to set the rowsource property of the embedded graph with VB. I've tried to create a sql and simply set it equal to the rowsource for the embedded graph. When I execute the report, I receive the message "Run time '438' - Object doesn't support this property or method". Normally, when I create a graph I create a query and then reference that query when the graph is created. I then manipulate the query vi VB to get the dynamic data display, but WHY can't I simply set the rowsource = to the sql string and eliminate all this overhead? Thanks ever so much for responding.
 
MichaelRed

You suggested to "Set the sla property of the named query". What si the "sla" property and how do you set the property for a named query? Thanks
 
Typo sla ~~~~ SQL

Instantiate it as a QURYDEF object and assing the text to the object property.

briefly:

Assume the query name ~ qryChartSrc

Dim qdf as QueryDef
Set qdf = querydefs("qryChartSrc")
qdf.Sql = "SELECT [FrameRelay-DLCI-Port].CustomerName, OVDB_ATTFRAMESTATS.RECORDING_WEEK, FROM [FrameRelay-DLCI-Port] ORDER BY [FrameRelay-DLCI-Port].CustomerName, OVDB_ATTFRAMESTATS.RECORDING_WEEK;"

or whatever ~~ legal query statement ...

probably some (minor) declarations missing ... see HELP ...




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
i still need more--
what are examples of possible where clauses?
does the criteria apply to different(and ever-changing) fields? is that the issue?

i agree with michael: you can use querydef to built the query, then save it as the same name every time. then of course just use that query name as the recordsource of the chart.
 
In general, I would probably not build the query anew each time, but make a parameterized query and just fill in the parameters, but that is a bit less straightforward.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Hello Ginger R,

what is/are your possible WHERE statements?
is there multiple criteria the users can select that applies to diff fields in your table/query?
where are they selecting/entering the criteria? in a form?
is the chart always based on the same table or basic query, but the WHERE clause changes diff ways, i.e. sometimes it's

Field1 = Forms!Main!txtField1Choice
and another time it's
Field2 = Forms!Main!txtField2Choice


My where clause does look like what u have been stating. Can you please tell me how to change the where clause in the rowsource of the chart. Pls do help me out.
 
i thought he was originally asking about one field changing criteria.

Field1 = forms!main!txtData only

if you need more maybe you'd want to post a new gig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top