![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have the following code below, which works if I do the following Call No1 'Call No2 Exit Sub For whatever reason it fails at Me![Passwords2].SetFocus at the end of Sub No2 with Run-time Error '2110' - Unable to goto control Any Ideas? CODE: Call No1 Call No2 Exit Sub Sub No1() strTest = Shell("C:\Program Files\MyApp\myapp.exe", 1) sSleep (100) AppActivate strTest SendKeys ("12345"), True SendKeys ("{Tab}{Enter}{Tab}"), True For intA = 1 To 20 SendKeys ("+{Down}"), True Next intA SendKeys ("^(c)"), True SendKeys "(%{F4})", True AppActivate "Microsoft Access" Me![Password1].SetFocus SendKeys ("^(v)"), True SendKeys ("{Tab}") End Sub Sub No2() strTest = Shell("C:\Program Files\MyApp\myapp.exe", 1) sSleep (100) AppActivate strTest SendKeys ("12345"), True SendKeys ("{Tab}{Tab}{Tab}{Tab}{Down}{Tab}{Tab}{Enter}{Tab} "), True For intA = 1 To 20 SendKeys ("+{Down}"), True Next intA SendKeys ("^(c)"), True SendKeys "(%{F4})", True AppActivate "Microsoft Access" Me![Passwords].SetFocus SendKeys ("^(v)"), True SendKeys ("{Tab}") End Sub |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |