Forum Discussion

subbu_valliappa's avatar
subbu_valliappa
Contributor
11 years ago

Keys Action misses entering a space

We have this line in our codes for entering parts of a formula:



TestObj.Keys(ELSE IF t ge G THEN)



However, the script has been entering "ELSE IF T geG THEN" on a number of times lately, and I'm not sure why. It's missing the space just before 'G' in the formula.



Does anyone know why this is happening? What can I do to improve the reliability?



Thanks in advance.
  • I've seen this happen with auto complete on some forms. Does the control support auto complete? You could use set text as Robert suggests as well. I prefer to use .Keys because it more accurately represents what a user will do.



    For testing purposes you could try:

    Adding a space/

    TestObj.Keys("ELSE IF t ge  G THEN")

    Breaking up the keys/


    TestObj.Keys("ELSE IF t ge")

    TestObj.Keys(" G THEN")



    Just to see if you get different results.

    Hope that helps!
  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    I've seen this happen with auto complete on some forms. Does the control support auto complete? You could use set text as Robert suggests as well. I prefer to use .Keys because it more accurately represents what a user will do.



    For testing purposes you could try:

    Adding a space/

    TestObj.Keys("ELSE IF t ge  G THEN")

    Breaking up the keys/


    TestObj.Keys("ELSE IF t ge")

    TestObj.Keys(" G THEN")



    Just to see if you get different results.

    Hope that helps!
  • Thanks for your replies.



    I have tried SetText but I slightly prefer Keys.



    Additional space works fine, always. Splitting the statement works on and off, just as before. Interesting find though, but that's what works.