Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 26th, 2004, 08:55 AM
ewall's Avatar
ewall ewall is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Portland, Maine, USA
Posts: 7 ewall User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Using CommandBar to kick off some functions

After chopping up some of the code from http://www.experts-exchange.com/Dat...Q_20838228.html I've made some nice functions to export to and chart in Excel... Now I want to have the users be able to access them easily.

Ideally, I'd like to use the CommandBar stuff to make a floating toolbar that automagically appears for the queries that can use it (that's easy--use the events to change the appropriate property to visible). However, I have 2 needs/problems with this:

1.) How can the CommandBar button know which query or form I'm currently viewing? There must be some value for "currently viewing this ___" that I can pass the function, yes?

2.) One of the buttons can only work on a subset of the those queries/forms, so I'd like to have it "greyed out" (i.e. unclickable, inactive) programmatically... but how?

Of, if you have other ideas for making my charting functions easily accessible in the UI for a number of queries, send 'em my way...

TIA-- ~ewall

Reply With Quote
  #2  
Old February 26th, 2004, 11:18 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Personally I would create a custom Toolbar/Menu that I would put everything in and have it display when you are displaying queries and reports.

They the always display towards the top of the screen, just like the other toolbars.

S-

Reply With Quote
  #3  
Old February 26th, 2004, 11:53 AM
ewall's Avatar
ewall ewall is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Portland, Maine, USA
Posts: 7 ewall User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
...but how?

That's just it--I've created the custom toolbar, but I don't know how to tell it what query I'm currently viewing to feed the function (e.g. =CreateChart("<query name>") ).

Furthermore, I can't seem to find any events attached to opening a query or form wherewith I could set the toolbar to 'visible' and maybe set a variable it could use in the function (e.g. =CreateChart( strCurrentQuery) ).

~ewall

Reply With Quote
  #4  
Old February 26th, 2004, 12:51 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Where you enter the code to display the query (on your form) include the following code

DoCmd.ShowToolbar "CustomqueryToolBar", acToolbarYes
or
DoCmd.ShowToolbar "CustomqueryToolBar", acToolbarNo



S-

Reply With Quote
  #5  
Old February 26th, 2004, 03:10 PM
ewall's Avatar
ewall ewall is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Portland, Maine, USA
Posts: 7 ewall User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Great! So I need to make every query into a form for that, I assume... No problem.

To more easily solve the problem of some queries not being able to use all the buttons, I just made multiple custom toolbars.

For passing the parameter of the query name to the function, I have the launching event set a public variable.

I think that'll work for everything--Thanks!

~ewall

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Using CommandBar to kick off some functions


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT