Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
| 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 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
  #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
  #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


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





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