Open hidden database window

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want a button on a form to close the form and open the hidden database
window, why doesn't SendKeys "{F11}" get triggered in the following code.

Private Sub btnOK_Click()
On Error GoTo Err_btnOK_Click
SendKeys "{F11}", False
DoCmd.Close
Exit_btnOK_Click:
Exit Sub
Err_btnOK_Click:
MsgBox Err.Description
Resume Exit_btnOK_Click
End Sub
 
LF said:
I want a button on a form to close the form and open the hidden database
window, why doesn't SendKeys "{F11}" get triggered in the following code.

Private Sub btnOK_Click()
On Error GoTo Err_btnOK_Click
SendKeys "{F11}", False
DoCmd.Close
Exit_btnOK_Click:
Exit Sub
Err_btnOK_Click:
MsgBox Err.Description
Resume Exit_btnOK_Click
End Sub


SendKeys is notorious for doing strange things.

Try using this instead:

DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowUnhide
 
Back
Top