Forum Discussion
Tony2021
Oct 24, 2022Iron 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
arnel_gp
Oct 25, 2022Iron Contributor
is 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
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
Tony2021
Oct 25, 2022Iron Contributor
Hi Arnel, that was it! Worked perfectly. thank you sir...
Hi George, I did try transferring the close code from the "On Click" to "On Enter" event to no avail. Maybe had something to do with not changing the Key Preview to "yes". thank you
Hi George, I did try transferring the close code from the "On Click" to "On Enter" event to no avail. Maybe had something to do with not changing the Key Preview to "yes". thank you