Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 12th, 2003, 06:36 AM
Registered User
 
Join Date: Jul 2003
Location: , , India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default ShowPopup doen't fire events on menu bar

In the end, I created a standard button with the image on it
and it calls the ShowPopup() function for a popup menu that gets displayed
right under the button.

The solution isn't pretty, but seems to work nicely.

This is working fine and its showing popup at exact position, but I am not
able to trace the sub menus click events. I have declared that with
WithEvents but it doesn't fire the events. What is the cause? Please let me
know if you have successfully implemented the same.

My code is like this:

Dim WithEvents ButtonSave As CommandBarButton
Set CmdBarPopup = OutlookApplication.ActiveExplorer.CommandBars.Add _
    (Name:="Custom", position:=msoBarPopup, Temporary:=True)

Set ButtonSave = CmdBarPopup.Controls.Add(Type:=msoControlButton,
Temporary:=True)
ButtonSave.Style = msoButtonIconAndCaption
ButtonSave.FaceId = 9
ButtonSave.Caption = "&Order Literature"
ButtonSave.Enabled = True

Now, ButtonSave_Click doesn't work. Do you know why? Please reply if you
have solution to this?

Regards,

Sumit Kalra
Software Engineer
New Delhi
India
Reply With Quote
  #2 (permalink)  
Old March 3rd, 2005, 11:13 AM
Registered User
 
Join Date: Mar 2005
Location: Westerville, OH, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Sumit,

I hope this helps
Your OnAction event will not work unless you are referring to a public function listed in your application modules.
You can declare it in your statement so that you can set it as a variable or you can hard code it in your commandBar menu.
Try adding this line to your code and reference a public function.

ButtonSave.OnAction = "FunctionName"

Regards,

Rance
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Before Right Click showpopup menu davespearce Excel VBA 0 December 11th, 2007 08:03 PM
Fire Events from Nested GridView adamh409 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 November 5th, 2007 01:18 PM
How to fire events from datagrid cell? param99 ASP.NET 1.0 and 1.1 Professional 2 November 15th, 2006 07:33 AM
How to trap Mouse events on Title bar/Caption bar chiefouko Pro VB.NET 2002/2003 0 September 21st, 2004 02:42 AM
ShowPopup doesn't fire events on menu bar sumit_kalra Excel VBA 0 July 12th, 2003 06:36 AM



All times are GMT -4. The time now is 02:09 PM.


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