English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have automated a few processes at work using the Sendkeys function through Access into AS400. Recently though I get sporadic results, wrong fields going into the wrong parts of AS400, skipping others, etc, on my computer. Funny thing is though, if I try it on my co-worker's computer, it works perfectly as it originally has. It used to work perfectly.

I did some trouble shooting and redirected it to a notepad document so I can see exactly what it is sending, and it works perfectly. So somewhere it is getting lost in the transition to AS400. I've tried inserting delays and slowing the whole thing down, to no avail.

Any suggestions to what it could be, or what I could troubleshoot next would be greatly appreciated

2007-02-06 04:46:24 · 2 answers · asked by R K 1 in Computers & Internet Programming & Design

Example:

AppActivate "AS400LS - A"

SendKeys Format([Loan#], "000000000"), True
SendKeys "{Tab}", True
SendKeys [Digit], True
SendKeys "{Tab 3}", True
SendKeys "9", True
SendKeys "{Tab 2}", True
SendKeys Format([Refund Numeric], "0000000.00") & "-", True
SendKeys "{Tab 2}", True
SendKeys Format([Refund Numeric], "00000000.00"), True
SendKeys "{Enter 2}", True

DoCmd.GoToRecord , "Frm_Partial To Escrow", acNext

If IsNull([Loan#]) Then

Me.TimerInterval = 0
MsgBox "Done!"
End If

2007-02-06 04:47:06 · update #1

2 answers

Merge all the SendKeys into one long one.

2007-02-06 05:06:13 · answer #1 · answered by BataV 3 · 0 0

sendkeys is a funny animal. I have a lot of experience with them in visual basic. They work well when your machine is at full speed, but a virus-scanner update could have slowed your machine down enough that a second sendkey is sent before the first has been processed.

VB has a sendwait command that waits for a respone from the keystroke before moving on. This works better, but can still screw up. The solution is always to insert pauses between keystrokes to allow the computer to process them.

2007-02-06 04:54:51 · answer #2 · answered by nitrojunkie78 4 · 0 0

fedest.com, questions and answers