Gene S
Gene S

Reputation: 2793

Automatically leave field after value is entered

I am creating a form in Visual FoxPro where the user will be entering a large number of values that are only one character values. So that the user does not have to press tab after every key press, I would like to setup the form so that once the value is entered the cursor automatically goes to the next field.

What is a good way to do this?

Upvotes: 0

Views: 1329

Answers (2)

Dhugalmac
Dhugalmac

Reputation: 574

Herb's answer is correct, but keep in mind that the cursor will jump to the next field in the TAB Order.
So if you entered your Textbox fields in some other order you might need to re-order the TAB's.
To verify that you have your TAB Order as you need, with the Form open in the VFP Development environment, from the Menu, click View - Tab Order - Assign Interactively. Then using your mouse, you can re-order the TAB settings for your Textboxes.

Also note that the TAB Order also includes the other Form objects such as Buttons, Grids, etc.

Good Luck

Upvotes: 1

Herb
Herb

Reputation: 650

Make sure you have SET CONFIRM OFF

From the help file:

SET CONFIRM ON | OFF
...
OFF Specifies that the user can exit a text box by typing past the last character in the text box. The insertion point, when it reaches the last character in a text box, moves to the next control, and the bell is sounded (if SET BELL is set to ON).

OFF is the default value of SET CONFIRM.

SET CONFIRM OFF also affects menu items and menu titles. If SET CONFIRM is set to OFF, the user can choose an item from a menu or a menu title in a menu bar by pressing the key corresponding to the first letter of the menu item or title. (When SET CONFIRM is set to ON, this action only selects the menu item or title.)

I made a simple form with two text boxes and verified that after typing one character, it jumps to the next text box.

Upvotes: 2

Related Questions