I have often wanted to allow users to double-click on a control to open the Zoom window, instead of having to revert to the Shift +F2 keyboard method.
The command SendKeys "+{F2}" works for the On_Click event but not for Double_Click. You can open a message box but not the Zoom window!
However, I have found that by putting a DoEvents after the SendKeys, it works reliably.
Expand|Select|Wrap|Line Numbers
- Private Sub Narrative_DblClick(Cancel As Integer)
- 'MsgBox "Double Click detected"
- SendKeys "+{F2}"
- DoEvents
- End Sub
Incidentally, I'm finding I need to put DoEvents in previously reliable code, after functions or calling procedures, to try and keep things synchronized. Whether this is because computers are faster or later versions of Access try multi-tasking, I don't know.
S7