Discussion Locked

Tab Controls in Access 2000

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have dropped the following code into my tab controls:

If Me.TabCtl1.Value = Me.TabCtl1.Pages("Page1").PageIndex Then
DoCmd.OpenForm FormName:="frmTabs"
End If

If Me.TabCtl1.Value = Me.TabCtl1.Pages("Page2").PageIndex Then DoCmd.OpenForm FormName:="frmOverTime"
End If

If Me.TabCtl1.Value = Me.TabCtl1.Pages("Page3").PageIndex Then
DoCmd.OpenForm FormName:="frmTraining"
End If

If Me.TabCtl1.Value = Me.TabCtl1.Pages("Page4").PageIndex Then DoCmd.OpenForm FormName:="frmTravel"
End If

If Me.TabCtl1.Value = Me.TabCtl1.Pages("Page5").PageIndex Then
DoCmd.OpenForm FormName:="frmContractExpense"
End If

If Me.TabCtl1.Value = Me.TabCtl1.Pages("Page6").PageIndex Then
DoCmd.OpenForm FormName:="frmOtherExpenses"
End If

What happens is that the tab I click on will open, but I must close the form before I can open another form. I would like to just click on any tab and have it open withouth having to close any form. Can somebody help me tweek the code to accomplish this?

5 replies

by mark.thomson

The code is fine, the problem is with your other forms, for the code to work you have to set the "modal" property ( found in the "other" tab of the properties dialog) of each of your forms to "no"

by donq

Mark is correct

Set you parent Form and all referenced Form "Modal" properties to "No".

Cool thought and logic

Of course you could also populate the entire form with a single Dynaset multi-table recordset like Microsoft recommends leaving the fields just as they appear under the current tabs. If you did that you could rename the tabs to e a little more user friendly (or informative).

This discussion is closed to new replies.