Newbie: How to set txt box to be visible, with option from combo list 
Author Message
 Newbie: How to set txt box to be visible, with option from combo list

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



Sun, 06 Mar 2005 11:11:35 GMT  
 Newbie: How to set txt box to be visible, with option from combo list
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

================================


Quote:
> 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



Sun, 06 Mar 2005 11:54:54 GMT  
 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

>.



Sun, 06 Mar 2005 13:29:34 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie: Set a combo box style(2)/Dropdown list to the first element in the list

2. Newbie: Set a combo box style(2)/Dropdown list to the first element in the list

3. Newbie: Set a combo box style(2)/Dropdown list to the first element in the list

4. Newbie - txt files into combo box

5. Combo Box - Setting list box height

6. multiple chk box options to a txt box

7. combo box/database combo box vlaue question - newbie

8. Setting Combo box ListIndex initiates Combo box Click event

9. list or combo box newbie

10. How to list macro names in a combo box or a list box

11. Newbie: set the selected item in a combo box programmatically

12. how to drop down a combo box list (newbie)

 

 
Powered by phpBB® Forum Software