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.
vamavAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
RgGray3Connect With a Mentor Commented:
Again ....  Eliminate the Database itself by taking a copy from the non-working computer to another computer where it has worked...

If it works there... it is not the Access MDB  we have eliminated any physical problem within the MDB
Then it is either the installation of Access. or the computer...

Check the service pack levels on two different machines...  (one that works and the one that does not)

something must be intercepting the keystroke...
0
 
KorbusConnect With a Mentor Commented:
I dont know of any windows setting that would effect this, so I would start with disabling all AntiVirus & security software on the problematic PC.
Have you made ANY other changes/updates to the system recently?
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

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

0
 
Jim Dettman (Microsoft MVP/ EE MVE)Connect With a Mentor PresidentCommented:

 While not a direct answer, I'd ditch sendkeys if at all possible.  Very problematic.  All a user has to do is switch focus to another window while your macro is running and the keystroke will end up going to the window that has the focus and not your app.

JimD.
0
 
vamavAuthor Commented:
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.
0
 
RgGray3Commented:
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)
0
 
vamavAuthor Commented:
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?
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Control Panel >> Accessibility Options ...

mx
0
 
vamavAuthor Commented:
Yes, I know where it is. But I wanted to say, what do I look for there, what settings?
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
I'm not sure. RgGray3 can help with that ...

mx
0
 
RgGray3Commented:
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.
0
 
vamavAuthor Commented:
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.
0
 
vamavAuthor Commented:
It now works again, but I still am not sure how it came about. Hope it stays so.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.