|
-
May 14th, 2001, 03:41 PM
#1
I need help with trapping an event about the Drop Down Combo box.
Hello, I have a combo box on the form, and I want to fill out information on the form in the other fields based upon what is selected in the combo box. My problem arises when someone clicks on the down arrow to bring up the list of stuff in the box and then select something. At that moment i'd like to display the information on the form, the problem is the only method I know of to use is the LostFocus. This means when the user selects something in the combo box, nothing is filled out on the form until that combo box looses focus. IS there anyway to change this, have the information pop up the minute something is selected in the combo box. I know there is a OnChange, OnClick, OnDropdown. the problem is, OnChange seems to only work if the user is typing their selection into the combo box. And the OnClick and OnDropdown would fire before anything has actually been selected. Sorry for such the long post, but a solution to this problem would be great. Thanks!!!
Shane
p.s. I know of third party controls that do this such as TrueDB Grid's Combo Box which has a OnDropDownClose event, but there has to be a way to do this in VB. Thanks
-
May 14th, 2001, 04:09 PM
#2
Re: I need help with trapping an event about the Drop Down Combo box.
I just ran into this problem myself earlier today. Use the combo box's Click event. Nothing will happen when a user clicks the down arrow, but the event will fire when a user makes a selection in the drop down combo box. Here's what I had to do (please remember this is a personal project and you will have to change the events that happen in this subroutine):
[vbcode]
Private Sub cboProdID_Click()
Dim found As Boolean
found = False
ProdRecSet.MoveFirst
Do Until found = True
If ProdRecSet!ProdID = cboProdID.List(cboProdID.ListIndex) Then
found = True
Else
ProdRecSet.MoveNext
End If
Loop
lblDesc.Caption = ProdRecSet!Description
End Sub
[vbcode]
In my application, I am looping through a recordset. But you can write your own events when the click event is fired.
-
May 14th, 2001, 04:49 PM
#3
Re: I need help with trapping an event about the Drop Down Combo box.
Excellent thanks a lot, that worked perfect!!
This will help me soo much on soo many projects. thanks again!
-Shane
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|