Skip to Content
author's profile photo Former Member
Former Member

search using sendkeys weirdness

I want to automate searching a field when an value is entered in an other field. (both are user defined fields)

As a user I would enter a value in user defined field 1, then click user defined field 2 and press shift-F2.

I think I need to do the same with code, so I've used the following commands:

oform.Items.Item("U_tlitemde").Click() 'set focus
SBO.SendKeys("+{F2}") 'send shift-F2

This does work, but the search result is removed afterwards for some reason. I see the search result for about 0,1 second and then the previous value is restored.

Is this the right approach and what could be the cause of this problem?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 08, 2005 at 11:28 AM

    The solution I found was to move the focus away afterwards, fortunately I has a third field I could move the focus to, because moving it back to the first field triggers the lost_focus even again.

    I find it weird that the lost_focus event in many cases isn't triggered (like when you leave the form, for example when you leave the user defined fields sub-form and go to the regular form). SBO apears to have a seperate focus for each form.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.