[AccessD] Call AfterUpdate Event From Module

Gustav Brock Gustav at cactus.dk
Tue Oct 18 02:15:10 CDT 2005


Hi Dan

Not really, as you would have to pass the name of the function as a variable which you can't (well, sometimes, using Eval() but that can quickly become a mess).
One method is to move all the AfterUpdate subfunctions to a single AfterUpdate sub function:

Public Sub ControlAfterUpdate(ByVal strControlName As String)
  Select Case strControlName
    Case "txtDate1"
      Call txtDate1_AfterUpdate
    Case "txtDate2"
      Call txtDate2_AfterUpdate
    '... etc.
  End Select
End Sub

This sub you can call from the outside.
Not fancy but it works.

The fancy method is to implement WithEvents. Highly recommended.
Articles on this can be found on our own site, at Shamil's site, and - if you don't fall that much in love with JC that you just can't move beyond his title page - at John Colby's site.

/gustav

>>> dwaters at usinternet.com 18-10-2005 00:39 >>>
I need to call the field's AfterUpdate procedure (which is now Public) to
perform validation, which is different for different date fields.  Is there
a way to do this?

Thanks!
Dan Waters





More information about the AccessD mailing list