Hi,
do you mean you want to execute VBA code when a user presses the enter key
on their keyboard.
If so then there are a couple different options.
You could add a command button to the form...add your code to the on click
event of the command button. Then set its default property to YES (you can
find that property under the other tab in its property window). If you don't
mind the button being there then just leave it as is and if the user presses
the enter key on that form no matter where they are the code behind the
buttons on click event will be executed. If you don't want it visible then
set the buttons transparency property accordingly.
Furthermore, another approach would be to add evaluation code on the form's
keydown or keypress event which checks if the enter key was pressed and if
yes then execute your other code. Yet another option would be to set up an
AutoKeys macro which then executes your code. Look up autokeys in the access
help and it will guide you in setting up the macro and show you sample
syntax. Keep in mind that an autokeys macro will act globally in the whole
application unless you build in a functionality which makes it form specific.
HTH
Good luck