Simple Sendkeys macro to automate keystrokes

D

Doris

I want to do the simplest thing but it's not working. I
want to create 2 macros, one that executes these
keystrokes:
{F2}{Home}1{Down}

The other does the same, but inserts "2" instead of 1.
All I have in my macro code is sendkeys and these
keystrokes, but nothing happens when I run the macro.
What am I doing wrong?

Thanks (and sorry I'm so clueless).
 
D

Doris

I neglected to say I'm using Access 2000, and I want to do
these keystrokes within a form in datasheet view.
 
S

Steve Schapel

Doris,

I suspect that you have to do something to put the "focus" in the right
place before these keys are "sent". Where are you wanting this activity
to take place, and what event is supposed to trigger the macro?

Having said that, I should point out that SendKeys is avoided like the
plague by experienced developers. It can cause a number of problems,
and there is almost always a better way of doing the same thing.
 
S

SAmDeBMAN

I read today a crazy thing on microsoft. here it is, maybe it will hel
you.

start quote:
Because the dialog box suspends the macro, you must put the SendKey
action before the action that causes the dialog box to open and set th
Wait argument to No.
End quoate

i think this function is poorly explained by microsoft.

good luck,

sam

*I want to do the simplest thing but it's not working. I
want to create 2 macros, one that executes these
keystrokes:
{F2}{Home}1{Down}

The other does the same, but inserts "2" instead of 1.
All I have in my macro code is sendkeys and these
keystrokes, but nothing happens when I run the macro.
What am I doing wrong?

Thanks (and sorry I'm so clueless).


-
SAmDeBMA
 

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