A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Enter" key moving to next field



 
 
Thread Tools Display Modes
  #1  
Old March 19th, 2008, 12:03 AM posted to microsoft.public.access.forms
Bob Howard
external usenet poster
 
Posts: 71
Default "Enter" key moving to next field

Using Access 2003, what sort of command should I issue in my VBA code to set
the option to cause the "Enter" key to move to the next field?

bob


  #2  
Old March 19th, 2008, 12:05 AM posted to microsoft.public.access.forms
Bob Howard
external usenet poster
 
Posts: 71
Default "Enter" key moving to next field

follow-up --- I want this to work in Access 2007 environments as well since
some of my users have A2K7 on their computers.


"Bob Howard" wrote in message
...
Using Access 2003, what sort of command should I issue in my VBA code to
set the option to cause the "Enter" key to move to the next field?

bob



  #3  
Old March 19th, 2008, 12:18 AM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default "Enter" key moving to next field

Bob Howard wrote:
follow-up --- I want this to work in Access 2007 environments as well
since some of my users have A2K7 on their computers.


"Bob Howard" wrote in message
...
Using Access 2003, what sort of command should I issue in my VBA
code to set the option to cause the "Enter" key to move to the next
field? bob


That is the default behavior so just don't change it and you need no code
whatsoever.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #4  
Old March 19th, 2008, 04:25 AM posted to microsoft.public.access.forms
Bob Howard
external usenet poster
 
Posts: 71
Default "Enter" key moving to next field

Depending on how each of my users has this option set, my program will
respond differently. I want my program to respond the same, regardless.

And a large percentage of my users have a Runtime edition of Access ... so
they cannot set this option anyway.

So my question remains --- how do I set it via VBA?

bob

"Rick Brandt" wrote in message
...
Bob Howard wrote:
follow-up --- I want this to work in Access 2007 environments as well
since some of my users have A2K7 on their computers.


"Bob Howard" wrote in message
...
Using Access 2003, what sort of command should I issue in my VBA
code to set the option to cause the "Enter" key to move to the next
field? bob


That is the default behavior so just don't change it and you need no code
whatsoever.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com




  #5  
Old March 19th, 2008, 06:05 AM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default "Enter" key moving to next field

On Tue, 18 Mar 2008 21:25:16 -0700, Bob Howard wrote:

Depending on how each of my users has this option set, my program will
respond differently. I want my program to respond the same, regardless.

And a large percentage of my users have a Runtime edition of Access ... so
they cannot set this option anyway.

So my question remains --- how do I set it via VBA?

bob

"Rick Brandt" wrote in message
...
Bob Howard wrote:
follow-up --- I want this to work in Access 2007 environments as well
since some of my users have A2K7 on their computers.


"Bob Howard" wrote in message
...
Using Access 2003, what sort of command should I issue in my VBA
code to set the option to cause the "Enter" key to move to the next
field? bob


That is the default behavior so just don't change it and you need no code
whatsoever.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com



Using VBA, you can cycle through the database's form's collection,
opening, in turn, each form in Design View acHidden, and set the
EnterKeyBehavior property for each text control to False (False is
Default, True is New Line in field). Then close the form acSaveYes.
If you need any help with the actual code, post back.

However, if the user is using a runtime, they can't change the setting
from your original Default, so this won't affect them.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #6  
Old March 19th, 2008, 08:49 AM posted to microsoft.public.access.forms
Albert D. Kallal
external usenet poster
 
Posts: 2,874
Default "Enter" key moving to next field

And a large percentage of my users have a Runtime edition of Access ... so
they cannot set this option anyway.


Since they can't change this, then you are safe with the default...

However, here is code solution:

Application.SetOption "Move After Enter", 1

The tools-options, and then keyboard tab

0 = Don't move
1 = next field
2 = next record

In a2003 to find all of the settings as above, the help is REALLY REEALLY
nice in this regards.

From VBA editor, go help- and then search for:

set options in vba

The first hit is :

Set Options from Visual Basic

Choose the above, and you find a REALLY nice gem of a help topic on how to
set/get any of the values you see in the tools-options tab.

Here is a few common settings I use...even for runtime apps:

Application.SetOption "ShowWindowsInTaskbar", False
Application.SetOption "Themed Form Controls", True
Application.SetOption "Show Startup Dialog Box", False
Application.CommandBars.AdaptiveMenus = False

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada



  #7  
Old March 19th, 2008, 09:16 AM posted to microsoft.public.access.forms
Bob Howard
external usenet poster
 
Posts: 71
Default "Enter" key moving to next field

Thanks Albert --- that did it ! ! !

bob

"Albert D. Kallal" wrote in message
...
And a large percentage of my users have a Runtime edition of Access ...
so
they cannot set this option anyway.


Since they can't change this, then you are safe with the default...

However, here is code solution:

Application.SetOption "Move After Enter", 1

The tools-options, and then keyboard tab

0 = Don't move
1 = next field
2 = next record

In a2003 to find all of the settings as above, the help is REALLY REEALLY
nice in this regards.

From VBA editor, go help- and then search for:

set options in vba

The first hit is :

Set Options from Visual Basic

Choose the above, and you find a REALLY nice gem of a help topic on how to
set/get any of the values you see in the tools-options tab.

Here is a few common settings I use...even for runtime apps:

Application.SetOption "ShowWindowsInTaskbar", False
Application.SetOption "Themed Form Controls", True
Application.SetOption "Show Startup Dialog Box", False
Application.CommandBars.AdaptiveMenus = False

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada




  #8  
Old March 19th, 2008, 11:32 AM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default "Enter" key moving to next field

Bob Howard wrote:
Depending on how each of my users has this option set, my program will
respond differently. I want my program to respond the same,
regardless.


Perhaps they changed this on newer versions. In previous ones it is not a
user-specific Access level setting. It is a setting per-control on your
forms and the default is to move to the next field.

If they changed it to an Access level setting then you really have no
business mucking with the user's preference anyway.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #9  
Old March 19th, 2008, 02:50 PM posted to microsoft.public.access.forms
Bob Howard
external usenet poster
 
Posts: 71
Default "Enter" key moving to next field


"Rick Brandt" wrote in message
...
Bob Howard wrote:
Depending on how each of my users has this option set, my program will
respond differently. I want my program to respond the same,
regardless.


Perhaps they changed this on newer versions. In previous ones it is not a
user-specific Access level setting. It is a setting per-control on your
forms and the default is to move to the next field.

If they changed it to an Access level setting then you really have no
business mucking with the user's preference anyway.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


Rick, I see no setting in the controls regarding this option (my controls
are a mixture of combo boxes and text boxes).

bob


  #10  
Old March 19th, 2008, 03:31 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default "Enter" key moving to next field

"Bob Howard" wrote in message
...

"Rick Brandt" wrote in message
...
Bob Howard wrote:
Depending on how each of my users has this option set, my program will
respond differently. I want my program to respond the same,
regardless.


Perhaps they changed this on newer versions. In previous ones it is not
a user-specific Access level setting. It is a setting per-control on
your forms and the default is to move to the next field.

If they changed it to an Access level setting then you really have no
business mucking with the user's preference anyway.


Rick, I see no setting in the controls regarding this option (my controls
are a mixture of combo boxes and text boxes).


Look on the Other tab in the Properties window of your text boxes.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:24 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.