 |
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
|
|
|

April 13th, 2007, 08:58 AM
|
Friend of Wrox
|
|
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
|
|
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
|

April 13th, 2007, 09:22 AM
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|

April 13th, 2007, 10:09 AM
|
Friend of Wrox
|
|
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
|
|
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
|

April 13th, 2007, 10:17 AM
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Ayaz,
Happy Friday =D
Encase the dates in Hashes (e.g. #27/11/2002#) that should do the trick.
Rob
|

April 13th, 2007, 10:18 AM
|
Friend of Wrox
|
|
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
|
|
i found it
like Good friday
where Orders.OrderDate between #01/01/2001# and #01/02/2001#;
|

April 13th, 2007, 10:20 AM
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
So did that work OK?
Rob
|

April 13th, 2007, 10:43 AM
|
Friend of Wrox
|
|
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
|
|
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
|

April 13th, 2007, 10:52 AM
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|

April 13th, 2007, 11:08 AM
|
Friend of Wrox
|
|
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
|
|
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
|
|

April 13th, 2007, 11:12 AM
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|
 |