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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Charts in reports changing them with code

Status
Not open for further replies.

Chance1234

IS-IT--Management
Jul 25, 2001
7,871
US
i have a chart and through code i want to change the criteria in one of the fields along with the scaling of the X-Axis depending on the criteria. so from a form i can select a button with the criteria on and bang there is my chart.

im having real trouble referencing a chart object in a report in VBA please can someone put us in the right direction


 
First make sure you have the Microsoft Graph reference library checked. That way you can reference the object and it's controls via code. If you aren't sure how, go to the VBA Editor and click on the "Tools" menu, then select "References". Make sure Microsoft Graph 9.0 Object Library is checked. Make use of the "Help" menu after checking the library, that way your help menu will offer more assistance on the objects in the library.
Bryan Meek
bmeek@pacbell.net
A "Solution Provider" in your corner gives you the personal attention you need to find the right technology solutions for your business.
 
Hello,

I'll go backwards.

The X axis should scale automatically as the data changes. Therefore, you shouldn't have to do anything to get this behavior.

As far as changing the criteria. In the report design, set the charts recordsource to a query. In the query, set the criteria to reference the text box on the form. Whenever you click the button, the query will automatically reference the text box in the form and you don't have to mess with changing the chart object.

I hope this is helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top