
Newbie: How to set txt box to be visible, with option from combo list
Hi,
I had tried something similar. Here my code.
Private Sub Purpose_Click()
If Form!Purpose = "Others" Then
Form![Purpose DataStoreText].Visible = True
Else: Me![Purpose DataStoreText].Visible = False
End If
End Sub
(Error given)
run-time error "438"
Object doesn't support this property or method.
-------------------------------------------------------
Your code:
(Gives error)
run-time error "451"
Property let procedure not defined and properly get
procedure did not return an object.
Qns:
1. If Me.MyComboBox(0) = "Others" Then:=> What does the
(0) refers to? the location of the line "Others"?
2. Did I refer to the wrong location with my code? I
couldn't figure out the error code, the access help,
didn't go to the details...
Thanks.
Karen Chia
Quote:
>-----Original Message-----
>Try this (untested aircode - no error handling):
>Private Sub MyComboBox_AfterUpdate()
> If Me.MyComboBox(0) = "Others" Then:
> Me.MyTextBox.Visible = True
> Else
> Me.MyTextBox.Visible = False
> End If
>End Sub
>--
>HTH
>Tim Hansen
>================================
>> Hi,
>> How do I turn the text box visible if user choose a
>> certain option from the combo box.
>> Eg. Combo box has got 5 items. test,test1,test2,test3 &
>> others.
>> If user's choice is "others" a text box will turn
>> visible. (Not creating an additional pop-form.)
>> I've tried using these events: After Update, On Enter.
>> with if then else statements, but no avail.
>> Who can help?
>> Ciao,
>> Karen Chia
>.