arekowczarek Posted April 7, 2011 Report Share Posted April 7, 2011 I have a form field which is pre-populated with some content. I used "get control command" to gain access to this particular field. Here's what worries me. When I try to send some text to that filed via text type - send text directly to control, the text is placed in front of the text that was already in the filed. I tried to send <DEL> and <BACKSPACE>, and even <HOME><SHIFTDOWN><END><SHIFTUP><DEL> sequences to eliminate the old content but it doesn't work reliably (time delays are not the issue - checked it). I could use the mouse (or tab through the fields) and delete the content but that's not really the approach I'd like to use. I have to populate 30 000 forms each containing 10 fileds I want to interfere with, so every second matters (the action will be repeated every month so I need an efficient and reliable solution). Is there a trick to clear the field content with the use of controls? Quote Link to comment Share on other sites More sharing options...
acantor Posted April 8, 2011 Report Share Posted April 8, 2011 I have had similar problems when sending text directly to a control. In most cases, I "solve" the problem -- it's not a solution I like -- by putting focus on the field, and then sending the text via "simulating keystrokes. I avoid <ShiftDown> and <ShiftUp>: I prefer a sequence like <HOME><SHIFT><END><DELETE>, which probably gives the same result, but I am superstitious of commands that simulate holding down a key... Alan Quote Link to comment Share on other sites More sharing options...
terrypin Posted April 8, 2011 Report Share Posted April 8, 2011 Timely thread. I tried to use Get Control and Send text directly to control yesterday for the first time in many months and sporadically got exactly the same behaviour. Whereas '0' should have been replaced by '1080', it sometimes (not always!) became '01080', or '10800'. I ended up using the same method as Alan to get reliable operation, clicking in the box followed by Shift+End and then typing the new entry. I plan to return later to persist in trying the Controls approach, but this is probably a one-off and I'm impatient for a result. BTW, that part was eventually reliable, but I'm now stymied by another unusual issue. I'll post separately. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
acantor Posted April 8, 2011 Report Share Posted April 8, 2011 I ended up using the same method as Alan to get reliable operation, clicking in the box followed by Shift+End and then typing the new entry. Mouse movements may or may not be necessary. I usually find it sufficient to give focus to the target control, without clicking it. As usual, the decision is made case by case. Quote Link to comment Share on other sites More sharing options...
arekowczarek Posted April 9, 2011 Author Report Share Posted April 9, 2011 Thank you both for the input. I was going to use pre-populated form templates originally, but now I decided against it - I'll just use completely blank forms and won't have to struggle to clear content in the populated fields requiring changing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.