Update & DblClick

P

PeterM

I have a listbox and there is code for both the AfterUpdate and DblClick
events. However, when I double-click on the listbox, it's only executing the
AfterUpdate event; not the DblClick event. Is there a way in VBA that I can
determine if it was a double-click or just a single-click on the listbox? If
so, I can call the DblClick event myself.

thanks in advance
 
O

Ofer

Two ways to know which sub is running
1. Place a MsgBox in each with a different message
2. Put a code break (press F9) on the first line of each sub, the code will
stop and you can see in which sub
 
P

PeterM

thanks for responding....I wasn't clear on my question....I know how to debug
VBA...I'm asking what VBA code can I write to determine which event is
firing? If you have both and AfterUpdate and DblClick event on a listbox
ONLY the AfterUpdate is executed, not the DblClick. I need to do two
different sets of code...one for AfterUpdate and another for DblClick...
 
O

Ofer

I just checked it, the afterUpdate code run first, and the Double Click event
run second.
You can create a Global variable which you can set differently for each
event, that way you can know which event is executing
 
P

PeterM

I'm running AC 2002 and it only fires the AfterUpdate Event. I put MsgBoxs
in the AfterUpate and DblClick events and only the AfterUpdate msgbox is
being displayed.

Is there an option in Access that controls this maybe?
 
P

PeterM

never mind...the msgbox was causing the problem, when I took it out it ran
both events...thanks for your help!
 
D

Douglas J. Steele

I was going to chime in that for something like this, it's generally safer
to use Debug.Print statements rather than message boxes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top