[AccessD] Calling an AfterUpdate evnte proc. of a combo

jwcolby jwcolby at colbyconsulting.com
Mon Feb 9 10:49:30 CST 2009


This is possible, IF the AfterUpdate event exists within the scope of the calling subroutine and is 
actually called cbo_AfterUpdate.

If you have a cboPerson and cboState and cboCity then the event to call would be 
cboPerson_AfterUpdate, cboState_AfterUpdate, cboCity_AfterUpdate.  You see what I am saying?

My guess is the cbo is not CALLED cbo back where it exists.  You are trying to use a function to 
make something generic but the NAME of the objects AfterUpdate is not generic, and very likely the 
code cannot be seen from this function, the afterupdate sub is in the form's class and this function 
is where?  In a module?  Not the same scope.

So no, you probably cannot do what you are trying to do.

Now... if you had a class for your combo...

;-)

John W. Colby
www.ColbyConsulting.com


philippe pons wrote:
> Hi all,
> 
> I have a small proc. to which I pass a reference to a combo box.
> This proc has to synchronize the combo on the first item
> and run the AfterUpdate event proc.
> 
> Private Sub syncCboTest(ByRef cbo As ComboBox)
>     ' syn de la cbo de sélection du chapitre
>     cbo.SetFocus
>     cbo = cbo.ItemData(0)
> '    Call cboSelChap_AfterUpdate
>     Call cbo_AfterUpdate '<== this won't work!
> End Sub
> 
> The question:
> 
> How would you call the AfterUpdate event of a combobox that is represented
> by it's reference??
> something like: cbo_AfterUpdate!
> 
> If it is even possible!
> 
> Best regards,
> 
> Philippe Pons



More information about the AccessD mailing list