[AccessD] Accessing AfterUpdate Event from another procedure

Dan Waters dwaters at usinternet.com
Wed Aug 30 12:13:50 CDT 2006


Here's an example:

In my system, there is a form which lists all of the items that a user needs
to work on.  These items are from various business processes, where each
process has its own Main Form.

A user can click on a line in the list form.  This will open the Main Form
for that business process, and calls the afterupdate event of the
cboNameFilter combobox.  This will filter the form to just those records
that the user needs to address, and display the record that the user clicked
on in the list form.

Of course, when a user is in the Main Form, they can select someone else's
name from the cboNameFilter combobox to see what that person is currently
working on.  Or, they can push the Name Filter button to do the same thing
and filter the screen to their own items.

HTH,
Dan

-----Original Message-----
Subject: Re: [AccessD] Accessing AfterUpdate Event from another procedure

It isn't clear to me what you're trying to accomplish with this.
Perhaps you could explain it in overview, not the specifics but what you
hope to achieve as a result.  I still think trying to call the
afterupdate event of a combobox on another form is going the long away
around to get nowhere.

Charlotte Foust 

-----Original Message-----
Subject: [AccessD] Accessing AfterUpdate Event from another procedure

Hmmmm...
I always seem to get stuck when attempting to access and run code in an
afterupdate event when trying to call and execute the event from another
procedure in another module than the Form module the afterupdate event
code resides in....

So what are the clear cuts on this.... please

See the code snippet below

Regards
Borge

/Code snippet:

    If FIsLoaded("frmSystem") Then
            If FIsLoaded("frmControl") Then
                Dim strSecName As String
                Dim boolModuleNamePresent  As Boolean

                strSecName = Forms("frmSystem")("SecName")
                boolModuleNamePresent = DLookup("Screen1", "tblSystem",
"SecName = '" & strSecName & "'")

                If boolModuleNamePresent Then

                    Dim frm As Form
                    Dim ctrl As ComboBox
                    Set frm = Forms!frmControl
                    Set ctrl = frm!cboNav

                    ctrl.Value = "Clients"

                   'just for testing - tests ok!
                    Dim vValue0
                    Dim vValue1
                    Dim vValue2
                    Dim vValue3
                    Dim vValue4

                    vValue0 = ctrl
                    vValue1 = ctrl.Column(1)
                    vValue2 = ctrl.Column(2)
                    vValue3 = ctrl.Column(3)
                    vValue4 = ctrl.Column(4)
                   'end just for testing

                   'HERE: how do I call the AfterUpdate event of cboNav
in the open form called frmControl ??

                    ' cboNav_AfterUpdate to execute here

                    Set frm = Nothing
                    Set ctrl = Nothing


                Else
                        MyMsgBox "You do not have access to the Clients
Module" & vbCrLf & "Please see the System Administrator about this!",
vbInformation
                End If
            Else
                MyMsgBox "This Form requires frmControl to be loaded!",
vbCritical
            End If
    Else
        MyMsgBox "This Form requires frmSystem to be loaded!",
vbCritical
    End If




More information about the AccessD mailing list