Sendkeys in a Macro in MS Access 2000

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the gotocontrol command along with a
sendkeys command to move to a text box and select the text
in that box. The reason I need the text selected is to
copy the text. The gotocontrol works fine but the sendkeys
does not seem to do anything. This is what I am using as
the sendkeys keystrokes parameter:

(+{Down})

This should emulate holding shift and pressing the down
arrow.

Any suggestions will be greatly appreciated!

Thanks,

Kurt
 
You can set the Tools/Options/Keyboard /Behavior Entering
Field setting to "Select entire field"
or try
({HOME}+{DOWN})
 
Kurt,

SendKeys is generally regarded as a problematic and non-robust method.
To achieve your purpose, I would suggest using SetValue macro actions
to affect the SelStart and SelLength propeties of the control. It
will look like this...

Action: SetValue
Item: [YourControlName].[SelStart]
Exression: 0

Action: SetValue
Item: [YourControlName].[SelLength]
Exression: Len([YourControlName])

- Steve Schapel, Microsoft Access MVP
 
Thanks for your help!
-----Original Message-----
Kurt,

SendKeys is generally regarded as a problematic and non- robust method.
To achieve your purpose, I would suggest using SetValue macro actions
to affect the SelStart and SelLength propeties of the control. It
will look like this...

Action: SetValue
Item: [YourControlName].[SelStart]
Exression: 0

Action: SetValue
Item: [YourControlName].[SelLength]
Exression: Len([YourControlName])

- Steve Schapel, Microsoft Access MVP


You can set the Tools/Options/Keyboard /Behavior Entering
Field setting to "Select entire field"
or try
({HOME}+{DOWN})

.
 
Back
Top