I have a Main Form called frmPurchaseRequest that has a tab control (TabCtl0) on it with three tabs. Each tab uses the same sub form to capture data entry (context oriented each tab represents a different way of acquiring goods and services). the intention is to have a client click on a tab and the sub form would display different text boxes and controls depending on the tab opened. Unfortunately I cant get the ON Change event to enable or disable the controls properly. At the moment if you click on the desired tab in this case HC1000 Purchase Request (pagHc1000) it does nothing, but when you click on the previous tab LPO-CreditCard (pagLPO) (it disables the textbox (txtPO_Number) I wanted it to disable when you click on HC1000 Purchase Request.
'Code to execute:
Private Sub TabCtl0_Change()
Dim intCtrlVal As Integer
intCtrlVal = Me.TabCtl0.Value
'intCtrlVal = 3
Select Case intCtrlVal
Case 0
'code to execute if LPO-Credit (pagLPO) Card is selected
'this executes properly
MsgBox " you have selected LPO Credit Card"
Case 1
MsgBox " you have HC 1000 Purchase Request"
'code to execute if HC1000 (pagHc1000) is selected
'below does not in the app this code is all one line
Forms![frmPurchaseRequest]! [frmPurchReq_Sub].Form!txtPO_Number.Enabled = False
Case 2
'executes properly
MsgBox " you have selected CFA"
'code to execute if CFA is selected
Case Else
MsgBox "There has been an error!"
End Select
End Sub
'End of code to execute
I can post the database file if necessary
Polnichek
'Code to execute:
Private Sub TabCtl0_Change()
Dim intCtrlVal As Integer
intCtrlVal = Me.TabCtl0.Value
'intCtrlVal = 3
Select Case intCtrlVal
Case 0
'code to execute if LPO-Credit (pagLPO) Card is selected
'this executes properly
MsgBox " you have selected LPO Credit Card"
Case 1
MsgBox " you have HC 1000 Purchase Request"
'code to execute if HC1000 (pagHc1000) is selected
'below does not in the app this code is all one line
Forms![frmPurchaseRequest]! [frmPurchReq_Sub].Form!txtPO_Number.Enabled = False
Case 2
'executes properly
MsgBox " you have selected CFA"
'code to execute if CFA is selected
Case Else
MsgBox "There has been an error!"
End Select
End Sub
'End of code to execute
I can post the database file if necessary
Polnichek