There has to be a better way than sendkeys??

S

Saudade

I am designing a form for data entry and my users don't want to use a
hyphen in the one of the fields - they think that the » would be more
appropriate.

I would like to alias - to » and so far the only way I found was to
use the key_press sub of that control. I can't get send keys
"{BS}%(0187) to work since it has to be the numeric keypad numbers to
get the » to appear, so I created a macro to run the sendkeys (that
works?).

I am now a victim of the 'known bug' where sendkeys statements reset
numlock.

I tried the suggestion of a doevents between each sendkeys statement
but that hasn't changed anything :(

Is there a better way to change - to » without it messing up numlock?

Thanks in advance!
 
G

Guest

Without knowing what data you have other than the >> it's difficult to say.
Could you give an example of where the >> will appear?

One initial thought, do you actually need to input the >> could you not just
use an input mask?
 
A

Allen Browne

Use the KeyDown event of the text box where you want this substitution, and
change the value of the KeyCode.
 
S

Saudade

Is there a better way to change - to » without it messing up numlock?

Thanks in advance!


Oh, I forgot to mention that I have seen a code snippet on this group
that gets the status of numlock, turns it off, then turns it back on
after the sendkeys, but that doesn't work either - some people have
said that it doesn't work on NT 4 and guess what' I'm running :(

All I really need is to get numlock forced to be ALWAYS ON.

I don't want to have to install third party software tho - IT won't
allow that :(

Thanks again
 
S

Saudade

Andy Williams said:
Without knowing what data you have other than the >> it's difficult to say.
Could you give an example of where the >> will appear?

One initial thought, do you actually need to input the >> could you not just
use an input mask?


There is one field which contains journey details - from and to.

It's one field because we aren't bothered about stats for which
destinations are used, and sometimes people go from > to > to > to (or
even from>to / from>to) or whatever.

There isn't a fixed number of letters per destination or a fixed
combination so an input mask would be hard to set up.

Another poster said change the keycode - that would work but I don't
know the key code for » ? (Or is that alt-0187?)

Thanks in advance.
 
?

???

Saudade said:
I am designing a form for data entry and my users don't want to use a
hyphen in the one of the fields - they think that the » would be more
appropriate.

I would like to alias - to » and so far the only way I found was to
use the key_press sub of that control. I can't get send keys
"{BS}%(0187) to work since it has to be the numeric keypad numbers to
get the » to appear, so I created a macro to run the sendkeys (that
works?).

I am now a victim of the 'known bug' where sendkeys statements reset
numlock.

I tried the suggestion of a doevents between each sendkeys statement
but that hasn't changed anything :(

Is there a better way to change - to » without it messing up numlock?

Thanks in advance!
 
M

Mike Painter

If the >> always occurs in the same place, as the "-" does in a social
security number just format the display and save them keystrokes.
@@@-@@-@@@@ turns 123456789 into 123-45-6789.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top