[AccessD] Events Collection??

Andy Lacey andy at minstersystems.co.uk
Tue Oct 19 09:57:06 CDT 2004


Hi Michael
That looks great but when I open a form (A97 BTW) and iterate through its
properties I don't see any of the events, just things like its Name,
LastUpdated and stuff. What am I doing wrong?

--
Andy Lacey
http://www.minstersystems.co.uk



--------- Original Message --------
From: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
To: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] Events Collection??
Date: 19/10/04 13:33

>
> ----- Original Message -----
> From: "Andy Lacey" <andy at minstersystems.co.uk>
> To: "Access Developers discussion and problem solving"
> <accessd at databaseadvisors.com>
> Sent: Tuesday, October 19, 2004 6:42 AM
> Subject: [AccessD] Events Collection??
>
>
> > Can you enumerate through the event procedures of a form or control?
I
> want
> > to modify my homespun search routine to look for function calls
triggered
> > from an event (not from code), and was wondering if I can do a For
Each
> sort
> > of loop or if I've got to specify each event/
> > --
> > Andy Lacey
> > http://www.minstersystems.co.uk
>
> Andy,
>
> You can iterate through each Control and Form/Report
> using a properties loop:
>
> Const EVP As String = "[Event Procedure]"
> Dim prp As Access.Property
>
> For each prp in Obj.Properties
>     If IsEvent(prp.Name) Then
>         If prp.Value = EVP Then
>             '
>         End If
>     End If
> Next
>
> Function IsEvent(prpName As String) As Boolean
> 'Actually, this is a table in one of the A97 Wizards
>     IsEvent = False
>         Select Case prpName
>             Case "BeforeInsert", "AfterInsert",
"ApplyFilter"
>                 IsEvent = True
>             Case "BeforeUpdate", "AfterUpdate"
>                 IsEvent = True
>             Case "BeforeDelConfirm", "AfterDelConfirm"
>                 IsEvent = True
>             Case Else
>                 If Left(prpName, 2) = "On" Then
>                     IsEvent = True
>                 End If
>         End Select
> End Function
> ----
>
> Michael R. Mattys
> Mattys MapLib for Microsoft MapPoint
> http://www.mattysconsulting.com
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
>
>
>

________________________________________________
Message sent using UebiMiau 2.7.2




More information about the AccessD mailing list