View Full Version : Sendkeys going to other apps


wcboyd
08-30-2004, 10:19 AM
I have a subform that I am trying to have automatically refreshed every X number of seconds. I created a button so that the user could manually refresh and I created a macro that the timer interval can execute. The macro sends SHIFT + {F9}, which works fine so long as I am looking right at that screen, but if I pop over to Word or open an e-mail the SendKeys command sends the word "SHIFT" to that app.

I am sure I am missing something simple, but I would appreciate some insight.

Thanks,

Craig

Geoff Codd
08-31-2004, 02:08 AM
Hi there,

Rather than use send keys can you not use something like

Me.Form.Requery

On a timer event.

Thanks
Geoff

wcboyd
08-31-2004, 10:35 AM
Thanks Geoff,

I used the following code and it works well:

Private Sub Form_Timer()
Dim ctlForm As Control

Set ctlForm = Forms!frmTest![tblSample subform]

ctlForm.Requery
End Sub