When entering data in forms, after pressing <enter> key, one can choose preferred cursor behaviour:
a) doesn't move (stays in the same textbox)
b) moves to the next field (same record)
c) moves to the next record.
This can be set by going to:
Options -> Keyboard -> Move after enter.
Q:
Can this be done programmatically? On one of my forms within the same database I prefer say, a) whereas on another form b) is preferred. It is quite awkward to have to go to Options each time I am switching from one form to the other.
Read the setting:
? Application.GetOption("Behavior Entering Field")
Change the setting:
Application.SetOption("Behavior Entering Field") = 0

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> When entering data in forms, after pressing <enter> key, one can choose preferred cursor behaviour:
> a) doesn't move (stays in the same textbox)
[quoted text clipped - 6 lines]
> Q:
> Can this be done programmatically? On one of my forms within the same database I prefer say, a) whereas on another form b) is preferred. It is
quite awkward to have to go to Options each time I am switching from one
form to the other.
Lolik - 03 Jul 2004 17:29 GMT
Allen, spot on! Appreciate it...
Lolik
Clddleopard - 26 May 2008 17:20 GMT
Hi!
I'm trying to do this myself, but I don't quite understand your answer. I
tried putting the code in the form's open event and I got the compile error
argument not optional. Could I get a bit more help?
Thanks!
My database setting is to have the enter key move to the next field, but I'd
like in this one form for it to move to the next record.
> Read the setting:
> ? Application.GetOption("Behavior Entering Field")
[quoted text clipped - 16 lines]
> quite awkward to have to go to Options each time I am switching from one
> form to the other.
Jeanette Cunningham - 27 May 2008 01:07 GMT
Clddleopard
You just need to change the syntax to this
Application.SetOption "Move After Enter", 0
Jeanette Cunningham -- Melbourne Victoria Australia
> Hi!
> I'm trying to do this myself, but I don't quite understand your answer. I
[quoted text clipped - 26 lines]
>> quite awkward to have to go to Options each time I am switching from one
>> form to the other.
Clddleopard - 27 May 2008 20:39 GMT
Thanks! That did the trick!
> Clddleopard
> You just need to change the syntax to this
[quoted text clipped - 33 lines]
> >> quite awkward to have to go to Options each time I am switching from one
> >> form to the other.
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.