Forum Discussion
Tony2021
Oct 24, 2022Steel Contributor
Close Button on Report - Set Focus but doesnt close report
Hello Experts, I have a report that opens and on load I set the focus to the close button on the report. I want to be able to hit the enter key and close the report and although the button's foc...
- Oct 25, 2022is your Report in Report View?
i think it is.
bring it again in design view.
on the Report Property Sheet->Event->Key Preview: Yes.
now add code to the Keypress event of the Form:
Private Sub Report_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call yourCommandButton_Click
End If
End Sub
George_Hepworth
Oct 25, 2022Silver Contributor
Is it possible that the command button responds to a "Click" event, but not to an "Enter" event?
Does this technique work on a command button on a form?
What other trouble-shooting steps have you taken?