Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 13th, 2007, 08:58 AM
Friend of Wrox
 
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default How can show graphs in MS Access form

Hi all,

I want to show graph based on table in MS Access, which is using VBA

any idea will be appretiated

Regards

Ayaz

 
Old April 13th, 2007, 09:22 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ayaz,

While in form design mode, you can click "Insert -> Chart.

Then draw where on the form you would like the chart, and a Wizard will pop up walking you through the process.

Regards,
Rob

 
Old April 13th, 2007, 10:09 AM
Friend of Wrox
 
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default

hi rob i did that but u know it friday nothing works

SELECT Orders.Order, Orders.Payterm, Orders.OrderDate,
FROM Orders where Orders.OrderDate between '27/11/2002' and '27/11/2003';
 where 27/11/2003 is date/time datatype
due to some reason access doesnt like it i remeber in SQL server we use datetime(convert,"27/11/2003") ... crying about access

 
Old April 13th, 2007, 10:17 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ayaz,

Happy Friday =D

Encase the dates in Hashes (e.g. #27/11/2002#) that should do the trick.

Rob

 
Old April 13th, 2007, 10:18 AM
Friend of Wrox
 
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default

i found it
like Good friday
where Orders.OrderDate between #01/01/2001# and #01/02/2001#;

 
Old April 13th, 2007, 10:20 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

So did that work OK?

Rob

 
Old April 13th, 2007, 10:43 AM
Friend of Wrox
 
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default

Hi
Now i have done all that and but but still standing on point A ..:)
when inserting graph it ask for table , query or both
now i have 1 more combo box which takes year as input so it will show the graph by year respectivly

in other words graph take value on form load event not when i am trying to inserting it in design mode

lost again

cheer



 
Old April 13th, 2007, 10:52 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ah I'm with you.

Create a Query based on the SQL you gave, but filter it by the combo box on the form.
So create the query in design view
Right click on the "Year" criteria
Click "Build"
Then double-click "Forms"
Double-click "All Forms"
Select the form in question on the list
The controls on the form will then be listed on the middle list, double click the combo box name.
This will then create a reference to the combo for the query criteria.

Then, on the form, go to the Combo_AfterUpdate event, and tell the chart to Requery.

This will cause the query to re-run in the background and refresh the chart data.

Hope this helps,
Rob


 
Old April 13th, 2007, 11:08 AM
Friend of Wrox
 
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default

Build is not highlighted
Quote:
quote:Originally posted by robzyc
 Ah I'm with you.

Create a Query based on the SQL you gave, but filter it by the combo box on the form.
So create the query in design view
Right click on the "Year" criteria
Click "Build"
Then double-click "Forms"
Double-click "All Forms"
Select the form in question on the list
The controls on the form will then be listed on the middle list, double click the combo box name.
This will then create a reference to the combo for the query criteria.

Then, on the form, go to the Combo_AfterUpdate event, and tell the chart to Requery.

This will cause the query to re-run in the background and refresh the chart data.

Hope this helps,
Rob


 
Old April 13th, 2007, 11:12 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

Odd, it always appears in mine, even if I have not selected any tables or anything?!!

Are you workin on an Access MDB or ADP??

Rob






Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access Form Bind With OO4O MTForm Access VBA 4 February 27th, 2008 04:29 PM
ms access form as criteria on sql server backend ottos13 Access 1 September 13th, 2006 12:14 PM
problem using ADO to open form in MS Access apike VBScript 3 May 2nd, 2006 06:25 AM
Microsoft Web Browser used in MS Access Form jeff1804 Access 8 December 9th, 2005 07:17 PM
instantiate a form object by its name in MS Access sky2000 Access VBA 1 May 6th, 2004 03:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.