Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2005
    Posts
    68

    Unanswered: navigating nested subforms

    i use three levels of forms in my application.
    [main] > application logo, main navigation buttons
    [subform1] > specific control buttons, user tips
    [subform2] > datasheet
    i do this to separate my format, controls, and data

    i am having a problem with my controls on [subform1].

    [subform1] includes the navigation buttons for [subform2], as well as a search function, etc.
    when i test [subform1] alone all of the controls function as planned.
    when i nest the completed [subform1] in [main] the navigation controls on [subform1] stop working with [subform2].
    all of the rest of the controls continue to work (search function, etc.).

    i have tried every method i have found of referencing the nested subform, but can't get the nav buttons to work. the cursor stays in the first field of the first record. what is even more confusing is that i disabled my error handler on the nav button code while debugging, and while the cursor is not moving vba appears to think it is. after cycling through the sample files i get the "you can not go to the specified record" error.

    i have tried to use vbconstants
    DoCmd.GoToRecord , , acNext
    as well as pointing directly to the record i want
    DoCmd.GoToRecord , , 4

    is there a dao or ado solution?

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Subforms

    Not sure if it helps but just remember when pointing to a control on a subform (or subsubform) the expression is:

    Forms!MainForm!MainFormSub.Form!Control

    or

    Forms!MainForm!MainFormSub!MainFormSubSub.Form!Con trol

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    "i do this to separate my format, controls, and data"?????

    That just doesn't make a lot of sense to me, and is probably at the root of the problems you are having. I'm afraid it may be unnecessarily complicating your application, with little or no benefit.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Jan 2005
    Posts
    68
    I agree with you partly. I do this to avoid duplicating controls and code, as well as speeding up the forms (the main form with the images is only opened once). I am going to switch to two forms, the main form with the images and all of the controls, and the subform which drops into the main form.

Posting Permissions

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