Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Northern VA
    Posts
    3

    Angry Unanswered: calling public form sub failing

    I have a frmCalendar that allows users to select a date from a "popup" calendar. I call it from two different forms. The on_close event of frmCalendar calls the Updated_Dates public sub of the parent form with the line:

    Call Forms(gblctlSelectedDate.Parent.Name).Updated_Date s(gblctlSelectedDate.Name)

    I have frm1, where frm1 is the main form and on the on_close event of the frmCalendar it successfully calls the parent's public sub. I have a second form that is a sub, of a sub and it doens't call the parent's public sub correctly. Both forms have the identical "public sub updated_dates(strDateControl as Control)" code.

    I've checked the value of gblctlSelectedDate.Parent.Name and it is referring to the correct form. I've checked gblctlSelectedDate.Name and it is pointing to the correct control name.

    Any ideas? I've tried specifying the sub form through the entire form hierarchy starting with the main form down, but that doesn't work either. I get no error messages, it just steps past the call (with a flicker of the screen) without doing it.

    Thanks a bunch!

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    If the code is not running then it is tied to the wrong event. This can be trickey in subforms.

  3. #3
    Join Date
    Nov 2002
    Location
    Northern VA
    Posts
    3
    It's executing the line fo code, but failing to call the sub routine. There is no doubt it's in the right spot. The problem is in the reference to the sub forms public sub...

Posting Permissions

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