Data Entry on a Form with Tab Control

Judy

Registered User.
Local time
Today, 18:50
Joined
Sep 26, 2000
Messages
34
I'm also posting this in the Forms forum, so please don't waste your time reading it twice!

I have a form to enter employee information using a Tab Control with two tabs. The first tab includes the employee's personal information, the second tab includes the employee's work location information. The tab index property of the Tab Control is set to 0. Problem is, when all of data is entered into the fields on the first tab, a new blank form appears (it moves to the next record). Is there a way to make the cursor move to the next field on the second tab so that data is entered before going to the next record?

I've tried DoCmd.GoToPage on the form's Before Update event, but, unless I'm using the wrong syntax, it won't work!

Any suggestions??

Thanks!

Judy
 
try using the setfocus on the lostfocus event of the last control on the first page.

Like if txtCustZip were the name of the last control on the Address page, and you wanted to go to txtSpouse field on the Family page, you would use

txtCustZip_LostFocus()
me!txtSpouse.setfocus

I think this will work, you might need to set focus to the Family page first though.


Charity
 
Thank you Charity, this worked. I appreciate the help!
 
Jumping back to new tab form entry after update

Hi,

I have created a 4-tab form. After entering the last field in Tab no 4, I would like the program to start a new data entry in Tab no 1 after updating the last the last record (when user press the enter key). Appreciate your help. Thanks.
 
Taurus5,

a simple solution might be to put a "New Record" command button on the form. The Access Wizard will make one for you. You can hide it if you like. Then, use the code given above to make it the next tab item.

Maybe even easier, put in the Lost Focus portion of the last text box you enter data in:

Code:
txtlasttextbox_Lost Focus()

DoCmd.RunCommand acCmdRecordsGoToNew

me!txtfirsttextbox.setfocus

Maybe something like that (not tested)?

Joe
 

Users who are viewing this thread

Back
Top Bottom