Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004

    Question Unanswered: Multiple Subforms & references


    I have created a subForm as a timer/counter display.

    I then place several of these on my main form to display different times.

    So that I don't have to mess around with a label on the main form for each one, I have put a label (lblLabel) in the actual subform.

    I want to place a string in the .Tag property of the subForm control on the parent form, and when the form is loaded (or strictly, as the subForm is loaded), I want to dynamically set the caption on that subForm label to whatever is in the .Tag property (Does this make sense so far??!!)

    Eg: my subForm is called sbfTimer

    on my main form, I have several subForm controls called sbfTimer1, sbfTimer2 etc. In the Form_Load event of the subForm, I want to reference the .Tag property of the particular parent control of that instance (Me.lblLabel.Caption=....)


    I'm pretty sure it has to do with the Hwnd property of the subForm, but I'm not quite sure of the reference.

    Any help would be much appreciated!



  2. #2
    Join Date
    Jun 2002
    Mpls/St.Paul area
    I've never used the Hwnd property. Looks interesting.

    I think you can set the caption property of the subform's label equal to the tag property of some control on the parent form when the subform 'on current' or 'on open' is run. Attached is a very handy one page description of the syntax for referring to controls on subforms or parent forms.

    I don't who Keri Hardwick is, but he/she may have been the original author.

    Attached Files Attached Files
    This is the day the Lord has made, I will rejoice and be glad in it.

  3. #3
    Join Date
    Feb 2004
    Chicago, IL
    I have read your post several times and I am still a little confused. Where do you want the code? In the subform or in the main form?

    If you are working in the main form and making a change to a control on a subform use the following syntax:


    If however you are putting the code in the subform and setting a value in the Parent (Main Form) the syntax is:

    Me.Parent.lblLabel.Caption = IAmNotSure.Tag

Posting Permissions

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