Solved

sendkeys with ALT does not work

Posted on 2011-02-13
14
542 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:vamav
  • 5
  • 4
  • 3
  • +2
14 Comments
 
LVL 10

Assisted Solution

by:Korbus
Korbus earned 125 total points
Comment Utility
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
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
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
 
LVL 11

Expert Comment

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

0
 
LVL 57

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 125 total points
Comment Utility

 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
 

Author Comment

by:vamav
Comment Utility
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
 
LVL 11

Expert Comment

by:RgGray3
Comment Utility
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
 

Author Comment

by:vamav
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Control Panel >> Accessibility Options ...

mx
0
 

Author Comment

by:vamav
Comment Utility
Yes, I know where it is. But I wanted to say, what do I look for there, what settings?
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 125 total points
Comment Utility
I'm not sure. RgGray3 can help with that ...

mx
0
 
LVL 11

Expert Comment

by:RgGray3
Comment Utility
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
 

Author Comment

by:vamav
Comment Utility
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
 
LVL 11

Accepted Solution

by:
RgGray3 earned 125 total points
Comment Utility
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
 

Author Closing Comment

by:vamav
Comment Utility
It now works again, but I still am not sure how it came about. Hope it stays so.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now