Sendkeys in a Macro in MS Access 2000

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
 
J

Jack

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

Steve Schapel

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
 
G

Guest

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})

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top