Want to close a report by using Esc key. In 2003 this functionality works fine, but not in 2007.
In 2007 can get it to partially work by making report modal. I double click a form control and the report opens. Then press Esc and report closes. But if I use the magnifier to enlarge the report, then click the magnifier again to reduce it back to the original size, the Ecs key does not fire. I first have to click in the blue margin next to the report then Esc works. I know it is only one extra click but I'd really like it to work like it does in 2003.
Then thought I'd do an On key Down event but get error 2585, "action cant be carried out while processing a form or report".
Any ideas how to get this functionality working.
Private Sub Report_KeyDown(KeyCode As Integer, Shift As Integer)
'trying to close the report with Esc
If KeyCode = 27 Then
DoCmd.Close acReport, Me.Name, AcSaveNo