Link to home
Start Free TrialLog in
Avatar of vamav
vamav

asked on

sendkeys with ALT does not work

Question 1
I have a macro which contains sendkeys command with argument: %ea
It has worked for long time. Suddenly it does not work properly. It sends the e and a into the control were pointer is.

The same macro in the same database running on another computer  with exactly same operating system (XP Professional), MS Office 2003, etc. still works.

Therefore some settings must have changed in the first computer. But what?
P.S. CONTROL with "^" works properly.

Question 2
I have similar problem with other macros/commands, however, problem occurs occasionally. Again I have the two computers, with same operating system, same MS Access, same database, and some commands and macros work perfectly onl one computer and cause occasional crashes of the database (...MS Access encountered and error ... databse will be closed ...) on other computer, but not always.  
Is there a general notion what such differences may be caused. I have no clue where to start looking.
SOLUTION
Avatar of Korbus
Korbus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
You can also try the usual things ... Compact & Repair the db, reboot the system if you have not.
Occasionally, some programs - for example screen capture programs, which take hold of certain keyboard shortcuts ... check that.
Just some thoughts ...

mx
Avatar of RgGray3
RgGray3

WAG:  Check the specific computer to see if any of the Windoes Accessability Settings are intercepting the keystroke.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vamav

ASKER

Restarting computer does not help.
Repairing database also did not help.
I even tried with a new test database, it is the same. ALT and SHIFT are not carried out, but CTRL is carried out, i.e ^c works, but !a or %ea does not work, the letters after ! or % are simply sent to the control where the pointer happens to be. Hence  ! and % as keystrokes are not recognized.
no screen capture is active.
Did you check... the Windows Accesability features on the offending machine...
If I understand your problem... It works on some machines and not others...

(The same macro in the same database running on another computer  with exactly same operating system (XP Professional), MS Office 2003, etc. still works.)

So look at the computer not the database....  what makes this computer different?
Service pack level
Accessability features (some of which intercept keystrokes)
Avatar of vamav

ASKER

Yes, that's how it is. On one computer I have the problem. Same database on other computer with same OS and MS Access 2003, it works.
But originally it worked on both. I did not make any  changes on any setup, unless it was unintentional.
I understand, but I have no experience with these accessibility features. What do I have to check?
Control Panel >> Accessibility Options ...

mx
Avatar of vamav

ASKER

Yes, I know where it is. But I wanted to say, what do I look for there, what settings?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
First check to see if ANY of the options are selected (Filter, Toggle or Sticky keys)

Holding down the shift key too long turns one of them on,..  I keep stumbling on that one....
and there are other times that my shift key becomes WEIRD...  (sorry for using such a technical term  Making fun of myself not you)

At times using the shift stops working and I have to hit a letter twice to get the letter to appear.  or put another way hitting the shift key stops the next key from being sent to the keyboard,

Frustrating and I haven't figured out WHAT is causing that lack of functionality and if anyone has a clue or can tell me how to disable or UNINSTALL accessability ...   it would be appreaceated...

Another thing to research...
Does the offending computer have a different keyboard, or does the keyboard have special (extended) software (such as a multimedia keyboard for media playing, web surfing, special redefinable keys for specialized program access)

It could be the keyboard software.   I have a Lenovo Thinkpad, that has a keyboard utility to define hotkeys.

I'm grasping at straws.... but the point being it does not SEEM to be the program....

You can confirm this by taking the copy of the program OFF of the offending computer and running it on a working computer....   If it works...  you atleast know it is not a damaged mdb.
Avatar of vamav

ASKER

The problem does not come from keyboard. The key combinations work from keyboard.
But the simulation with the sendkeys command does not work.
So; ALT&e&a from keyboard selects the whole record.
But %ea from the sendkeys command just copies the letter a into the control where the pointer happens to be. But if I send just the "ea", then it copies "ea" into teh control. Apparently it skips the "%e"
The same problem with combinations starting with "!" as teh SHIFT. But it recognizes the ^ sign as CTRL. So, ^c works, but %ea does not work.
I checked  versions of the database several months old which worked before and there it is now the same. So the problem must really come from Access or Windows but not from database.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vamav

ASKER

It now works again, but I still am not sure how it came about. Hope it stays so.