Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calling a Subform Event from the Main Form (2003)

    How do you call a text box event in a subform from its containing form?
    I'm trying to launch the AfterUpdate event of text boxes on the subforms of the main startup form of the attached mdb using
    <pre>Private Sub PSPOL_AfterUpdate()
    Form_Gruppo4.Form.CNTOL_AfterUpdate
    Form_Gruppo5.Form.CNTOL_AfterUpdate
    End Sub</pre>


    but I get the message:
    "Run-time error '2465': Application-defined or object-defined error"

    What is the correct syntax?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calling a Subform Event from the Main Form (2003)

    1) Change the code to

    Private Sub PSPOL_AfterUpdate()
    Form_Gruppo4.CNTOL_AfterUpdate
    Form_Gruppo5.CNTOL_AfterUpdate
    End Sub

    2) Change both CNTOL_AfterUpdate procedures to Public. The main form cannot run them if they're Private.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calling a Subform Event from the Main Form (2003)

    BTW, next time please remove the MouseWheel code from your database before attaching it. You shouldn't assume that everyone has the necessary DLL.

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calling a Subform Event from the Main Form (2003)

    Oopsie!!!
    I forgot that one in there <img src=/S/blush.gif border=0 alt=blush width=15 height=15>
    Thank you Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •