events on combobox

paulevans

Registered User.
Local time
Today, 14:15
Joined
Mar 7, 2006
Messages
79
HI I hope this is a simple one for someone.

I have a combobox set as a lookup field in a table.
where row source set to:
"Sole Trader";"Partnership";"Private Ltd";"Public Ltd";"Other"

on my form I have its default value set to sole trader

what I would like to do is beable to show a new text box if the other option is selected.

I have created a text box called other1 which is hidden on form load using

me![other1].visible =false

I will need to amend this later to check if the field has a value and if so then show it but that is not my problem.

My problem is even if other is selected then my code ignores the changes and keeps the default value as Sole Trader.

My code is:

Me.Requery

If IsNull(Me![bustype].ItemData(0)) Then
MsgBox "you need to specifiy a Business type", vbOKOnly, "Warning"
Else
If Me![bustype].ItemData(0) = "Other" Then
Me![other1].Visible = True
End If

End If
Hope this makes some sense to someone soon.

Thanks
Paul
 
Boy that was quick.

Just what I wanted.

Thanks saved me hours.
 

Users who are viewing this thread

Back
Top Bottom