extract value from combo box

S

Shetty

Dear Friends

I have got 2 nos combo boxes in my form

On focus event of 2nd combo following actions must happen
1. automatic drop down on focus if current value is null
2. search and select the value from the combo list which is matching to
value of column(2) of combo1


Please help me out

Thanks & Regards

Ramesh Shetty
 
D

Douglas J. Steele

Why do you need it to automatically drop down if you're going to match the
value for it? The code below only drops down the combo if nothing's chosen
in the first combo:

Private Sub MySecondCombo_GotFocus()
If IsNull(Me.MyFirstCombo) Then
Me.MySecondCombo.Dropdown
Else
Me.MySecondCombo = Me.MyFirstCombo.Column(2)
End If
End Sub
 

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