Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to close DataReport?

Status
Not open for further replies.

miho1

Technical User
Oct 22, 2002
78
BG
Hi All

When I want that the form was closed when I press on Escape I write the code:

Private Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)

Select Case KeyCode
Case vbKeyEscape
Unload Me
End Select
End Sub

But when I want to close DataReport, at it is not present procedure " Private Sub Form_KeyDown "
How to close DataReport?


Miho


 
I'm not really sure u can! See the forms have an attribute which reads a Key before processing anything else called KeyPreview. If this attibute is set to true then the form reads the escape key and its up to you what you do with it!

Now, datareports do not have the KeyPreview attrib therefore its quite difficult to read the escape key! U may have to use API calls to do that for you! Give a search maybe they will come up with something!

goodluck

Nick
 
Do a search on this forum for KEYBOARD HOOK , using AllWords, Any Date

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top