try
VBA Code:
sub abc()
if combobox1.value = "Inventory In" then
textbox1.enabled = false
textbox2.enabled = false
textbox3.enabled = false
....
....
end if
end sub
where combobox1 is your transaction type and textbox1, 2, 3, .... are your Inventory out textboxes.
Rename your controls with reference to your userform....
hth...
Hi Mohadin,
Thank you for your quick response. The code did work just fine, just that when I pick inventory IN, it did disable the textboxes I want to disable (cmbCustName, txtSelling and the rest), however if I switch the transaction type to "Inventory Out" the disabled textboxes such as cbmCustName, txtSelling doesn not go back to being enable again. Is there any trick to fix this.
(please checked attached image)
Thanks again
Here are the codes I used.
Private Sub cmbTransType_Change()
If Me.cmbTransType.Value = "Inventory In" Then
Me.cmbCustName.Enabled = False
Me.txtSelling.Enabled = False
Me.txtQty.Enabled = False
Me.txtDate.Enabled = False
Me.txtProforma.Enabled = False
Me.txtPONo.Enabled = False
Me.cmbCustName.BackColor = 16777215
End If
If Me.cmbTransType.Value = "Inventory Out" Then
Me.txtRRNo.Enabled = False
Me.cmbOrderType.Enabled = False
Me.txtTransdate.Enabled = False
Me.txt_Qty.Enabled = False
Me.txt_Cost.Enabled = False
Me.txtSupplierInvoice.Enabled = False
End If
End Sub