I am not so sure if the answer is no, but definately not so sure about the question either. I am theorizing here, not sure if it is possible.
1) build a class (clsMyCombo)
2) set a private variable
private withEvents mComboControl as combobox
3) In the Set Property
Public Property Set ComboBoxCntrl(theControl As combobox)
Set mComboControl = theControl
mComboControl.afterUpdate = "[Event Procedure]"
End Property
4) Define an event procedure
private sub mComboControl_afterUpdate()
do something
end sub
5) On your form instantiate a clsMyCombo
dim mcComboClass as new clsMyCombo
set mcComboClass.ComboBoxCntrl = me.combocntrlOne
Now here is the theory. Do some procedure at the form level on afterupdate. You then will trap the same event at the clsMyCombo, I think. If possible you have theoretically done 2 seperate event procedures.
Bottom line. I can not think of a reason to do it, besides a mental drill.
Hi, PHS
I did not realize that I needed to state why, sorry.
I currently have a combo box that is bound to a table with 2 fields and has 4 different options/records in it, with an after update procedure, that has different calculations for each record. I want to add a Dlookup command that will display
the record that is chosen and it will need to be placed in the
after update procedure of the combo box also. Is this possible?
Here's more info. on what I'm trying to accomplish,
I currently have a combo box that is bound to a table with 2 fields and has 4 different options/records in it, with an after update procedure, that has different calculations for each record. I want to add a Dlookup command that will display the record that is chosen in another text box and it will need to be placed in the after update procedure of the combo box also. Is this possible?
Code that is currently in the after update procedure of the combo box.
Private Sub cbofelts_AfterUpdate()
Dim prp As Property, ctl As Control
Set prp = Me!cbofelts.Properties("ListIndex")
Set ctl = Me.txtfelts
If prp = 0 Then
ctl = ([TOTFLDSQ] / 4) + 0.4
ElseIf prp = 1 Then
ctl = ([TOTFLDSQ] / 2) + 0.4
ElseIf prp = 2 Then
ctl = [TOTFLDSQ] + 0.4
Else
ctl = ([TOTFLDSQ] / 3) + 0.4
End If
Hi, PHV
My bad, I had two text boxes with the same control source. And
I thought it was an issue with trying to add two event procedures into a single combo. That's what I get for copying and pasting text boxes on my form.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.