Assign macro to keyboard shortcut

I'm passing a variable from one record to the next on a form by attaching a macro to a 'Next'button.

In the same form, a user can navigate to the next record by pressing the Ctrl-Tab keyboard combination. How can I assign the macro above to this keyboard shortcut so that my variable can be passed to the next record via this keyboard shortcut?

Thanks in advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Simplest, change the caption on the Next button to  &Next, which means if the user presses Alt N, the buttons onclick event will fire.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
You could also use the Forms Key Preview event to see keys that are pressed no matter what control had the focus, or add the key storke combination to a macro called 'AutoKeys'

Using the latter though would make it app wide.    

Cleanest is using an short cut on the button.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nmicheleAuthor Commented:
Thanks Jim!
Jeffrey CoachmanMIS LiasonCommented:
I am not sure of the "timing" you need,. ...
But you could also try something like this on the current event of the form:

If Me.NewRecord Then
    DoCmd.RunMacro "YourMacro"
End If

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.