Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a form with subform with subform.
    When I close the form or load the form I let the sourceobject filled in on a condition.
    I have attached a stripped version.
    The form is frmproject
    this is the line that gives the error:
    Forms!frmProject!frmProjectHidden.Form!frmProjectH iddenDeuren.Form.SourceObject = "frmProjectHiddenDeuren"
    I'll hope that someone can help me.

    Kind regards,
    Nancy
    Attached Files Attached Files

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Hi Nancy,

    It appears to me that you do not have a subform control anywhere on the main form that has a subform control named frmProjectHiddenDeuren - which is why your are getting the error. I also don't understand the need for the nesting of subforms three deep - it appears there is nothing on the main form but the subform control frmProjectHidden - but that may be a result of you getting rid of things not necessary to understand the issue. Referring to subforms is always a bit tricky, especially if you are nesting them - it might help to give your subform controls a prefix that indicates it is a subform control and not a form bound to a subform control. Please post back if you conclude that isn't the issue.
    Wendell

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Forms!frmProject!frmProjectHidden.Form!frmProjectH iddenDeuren.Form.SourceObject = "frmProjectHiddenDeuren"
    Replace that line with

    Me.frmProjectHiddenDeuren.SourceObject ="frmProjectHiddenDeuren"

    This code is running within frmProjectHidden so Me refers to that form. Within that form there is a subform control named frmProjectHiddenDeuren.
    All you need to do is set the source object of a subform control to the name of a form.

    You have similar code in lots of places.
    Regards
    John



  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Sometimes I have trouble seeing the forest for all the trees!
    Wendell

  5. #5
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have tried it with Me.frmProjectHiddenDeuren.SourceObject ="frmProjectHiddenDeuren"
    but I still get the same error.
    if you would look at the attached database, you would see that there is a frmProjectHiddenDeuren!!
    The main form frmproject, is not yet completed, there will come a searchcombo field!
    There is a reason for the nesting with subforms.
    the first form frmproject = searchform witch will load frmProjectHiddenDeuren when there is one selected.
    the other subforms is because there are subtables
    tblproject has a subtable tblprojectdeuren and tblprojectdeuren has a subtable tblprojectdeurenpanelen.

    Can someone help me please, please open the file.

    Many thanks,
    Nancy

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    It worked for me when I made the change I suggested.
    But then I got the same error from another piece of code as you have similar expressions in lots of different places.
    So you need to change all of them.
    Regards
    John



  7. #7
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello John,
    I got it working, just like you said, I have changed all with me. and it works fine now.
    I alsow changed the name from frmprojecthidden to subfrmprojecthidden. So it is more clearly now.

    Thanks alot.
    greetings Nancy

Posting Permissions

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