Reference value of unbound control on a form

I

Isis

Using VB how do I reference the value of an unbound control on a form ?

The form has a combo box which contains displays a list of 'Types' from a
'Colours' Table - once the user has selected a value in this control I
want to reference the value chosen in VB.

The Control is called 'ListType' and I want to do something like;

If [LISTTYPE] = "Standard" Then
Do Something
Else If [LISTTYPE] = "Brown" Then
Do Something
Else
Do something else
End If

Thanks for any help
 
K

Klatuu

Just like a bound control. It makes no difference because you are
referencing the value of the control. It would simply be:
Me.LISTTYPE

I would also suggest a Select statement rather than a series of ElseIfs:

Select Case Me.LISTTYPE
Case "Standard"
Do Something
Case"Brown"
Do Something
Case Else
Do something else
End Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top