English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a list box that has 2 options: PSF & QTC. If PSF is selected, I want the Network field to be disabled. If QTC is selected, I want the Sales Order to be disabled. Can someone help me with the syntax?

2007-02-13 08:25:50 · 7 answers · asked by FAM 1 in Computers & Internet Programming & Design

7 answers

If List1.ListIndex = (whatever position your item to cause the disabling is) Then
txtNetwork.Enabled = False
Else:
txtNetwork.Enabled = True
End If

2007-02-13 08:34:47 · answer #1 · answered by Richard H 7 · 0 0

Private Sub List1_Click()
If List1.text = "PSF" Then

,network field disaabled code here
exit sub
End If

If List1.text = "QTC" Then

,Sales Order disaabled code here
exit sub
End If

End Sub

2007-02-13 08:33:28 · answer #2 · answered by Say Bye 1 · 0 0

assuming the network 'field' is a textbox, it's simply

If Listbox.selecteditem = "PSF" then
TextboxNetwork.enabled = False
End If

2007-02-13 08:32:54 · answer #3 · answered by rod 6 · 0 0

Here is a snippet.............

Private Sub Form_Load()
List1.AddItem "aa"
List1.AddItem "bb"
End Sub

Private Sub List1_Click()

If List1.Text = "aa" Then
Text1.Enabled = False
Else
Text1.Enabled = True
End If
End Sub

2007-02-13 08:38:40 · answer #4 · answered by ayir 1 · 0 0

fairly have been given 2 quarters to rub in my hand yet i'm able to write a poem as ultimate as i'm able to. Aint have been given no fancy stile valuable aint have been given no flooring made out of tiles. i'm in basic terms a detrimental housewife that needs a strengthen I valuable dont have a recent. stable write.. If i had 10 to furnish it to ya.

2016-09-29 01:52:13 · answer #5 · answered by ? 4 · 0 0

For VB.NET you can have a click event and then just do field.enabled = false; in your codebehind.

If you were meaning vbscript...well you can do it in javascript in a similar way by doing document.form.field.enabled = false; in the onclick function of the field.

2007-02-13 08:41:48 · answer #6 · answered by kniemczak 2 · 0 0

The me keyword refers to the current form. You need to add this code on the change event (I think) of the options

If me.PSF = true then
me.networkfield.enabled =false
end if

If me.QTC = true then
me.salesorderfield.enabled = false
end if

2007-02-13 08:35:28 · answer #7 · answered by flowerpot20007 1 · 0 0

fedest.com, questions and answers