zocker
08-05-2001, 01:03 PM
I am importing data into an Accounts program called Sage, from Access 2000 The code works except for the three lines hat simulate three down arrow keypresses. Key Presses work but the simulation does not but then works again for the rest of the procedure. Any ideas welcomed.
Regards
Private Sub Command0_Click()
Shell ("C:\sfw\sfw.exe"), vbMaximizedFocus
DoEvents
SendKeys "%F", False ' Send ALT+F to open &File Menu
DoEvents
SendKeys "I", True ' Send I to select 'Import Data'
DoEvents 'Let Windows have a turn & Give SFW.exe a chance to catch up.
SendKeys "{DOWN)" 'Move down one
DoEvents
SendKeys vbKeyDown 'Move down another
DoEvents
SendKeys vbKeyDown 'Move down another
DoEvents
SendKeys "%R" 'When Focus has noved down 3 check boxes then use Alt + R to Run it, this works OK
' SendKeys "(C:\sfw\Barry.csv)"
'MsgBox " Faulty"
Exit Sub
End Sub
Regards
Private Sub Command0_Click()
Shell ("C:\sfw\sfw.exe"), vbMaximizedFocus
DoEvents
SendKeys "%F", False ' Send ALT+F to open &File Menu
DoEvents
SendKeys "I", True ' Send I to select 'Import Data'
DoEvents 'Let Windows have a turn & Give SFW.exe a chance to catch up.
SendKeys "{DOWN)" 'Move down one
DoEvents
SendKeys vbKeyDown 'Move down another
DoEvents
SendKeys vbKeyDown 'Move down another
DoEvents
SendKeys "%R" 'When Focus has noved down 3 check boxes then use Alt + R to Run it, this works OK
' SendKeys "(C:\sfw\Barry.csv)"
'MsgBox " Faulty"
Exit Sub
End Sub