Peborgh
asked on
sendkeys funny in access VB with runcommand accmdfind
Access 2002 (XP)
I have the following code to try and persuade the find dialog box to start with correct settings using sendkeys. It works (sometimes but also sets caps lock on!
Come on, Bill gates! Any ideas?
"
' do the deed
Me.this.SetFocus '!!! whatever the first field is for any form
SendKeys "%ha%e%rd" ' any part of form and field and looking down, from MS documentation
Application.RunCommand acCmdFind
"
Thanks.
I have the following code to try and persuade the find dialog box to start with correct settings using sendkeys. It works (sometimes but also sets caps lock on!
Come on, Bill gates! Any ideas?
"
' do the deed
Me.this.SetFocus '!!! whatever the first field is for any form
SendKeys "%ha%e%rd" ' any part of form and field and looking down, from MS documentation
Application.RunCommand acCmdFind
"
Thanks.
ASKER
Err...
I pinched the code, incorporated into my app, compiled OK:
"
' do the deed
Me.this.SetFocus '!!! whatever the (first) field is for any form
FsendKeys "%ha%e%rd" ' any part of field and going down (uses a "safe" Sendkeys)
Application.RunCommand acCmdFind
"
... and it behaves just like the original SendKeys, setting caps lock ON.
What am I missing?
Many thanks,
peter
I pinched the code, incorporated into my app, compiled OK:
"
' do the deed
Me.this.SetFocus '!!! whatever the (first) field is for any form
FsendKeys "%ha%e%rd" ' any part of field and going down (uses a "safe" Sendkeys)
Application.RunCommand acCmdFind
"
... and it behaves just like the original SendKeys, setting caps lock ON.
What am I missing?
Many thanks,
peter
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Anyone out there know of an alternative, specifiable find/findNext proc/func?
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Getting back to the subject in hand, mySendKeys does work!! I was using Fsendkeys and that acted in the uncorrected way. Blame Bill gates.
So thanks to LPurvis for his help on sendkeys and (oVo) for his finding substiture - that knowledge was useful also.
peter
So thanks to LPurvis for his help on sendkeys and (oVo) for his finding substiture - that knowledge was useful also.
peter
http://www.mvps.org/access/api/api0046.htm