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?