Open hidden database window

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
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top