Sendkeys going to other apps

wcboyd

Registered User.
Local time
Today, 09:13
Joined
Aug 30, 2004
Messages
50
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
 
Hi there,

Rather than use send keys can you not use something like

Me.Form.Requery

On a timer event.

Thanks
Geoff
 
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
 

Users who are viewing this thread

Back
Top Bottom