Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Control

Status
Not open for further replies.

gianina

Technical User
Jul 4, 2006
56
CA
Hi there,

I have a form which contains a Tab Control.
This Tab Control has several tabs with fields in each of them.
I would like to lock the next tab if in the previous one the fields are empty. So, the user can't go and update fields let's say in tab no 2 until fields in tab no 1 are updated...and so on with all the tabs.

Can somebody help me ?

Thanks.
 
In the Design View, select the 2nd page of your tab control, and set the Enabled property to False. Then, in the appropriate place in your code, once all of the fields on the 1st page are filled in, you can set the Enabled property of the 2nd page to True.

Me.Page2.Enabled = True
 
rjoubert,

Can you explain where exactly should I enter the code you provided ?

Thanks.
 
I need more details on what is on your tab control. On the first page, I'm assuming you have a bunch of fields, right? Do you also have a button on the first page that will take you to the 2nd page (kinda like a wizard)?

If you do have such a button, you can put the "Me.Page2.Enabled = True" line in the code behind that button. However, if you don't have that button, you can add that line of code to the OnExit event of the last field on Page1. Personally, I would add the button if you don't have it. Some users may not know enough to click on the tab headers to get to subsequent pages in the tab control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top