How to show split Forms in navigation subform?

16,389

Solution 1

As far as I know, you cannot have a split-form as a subform. If you try, only the top part of the split form will be visible as you found out.

You can however try to build a "fake" split-form by hand by using a simple subform containing a datasheet that you link to the parent form.

You will then be able to include your "fake" split-form in the Navigation form.

Solution 2

Referencing Renaud Bompuis accepted answer. Answering to Antony Hatchkins. He asked how to link the two subforms with each other, so the corresponding item to the selected record in datasheet subform is shown in form subform

In parent form you model a public sub. In the datasheet subform you register the OnCurrent event. On which you read out the tables primary key and call the public sub of the parent with the primary key as argument.

The public sub sets the recordsource of the form subform with the correct sql including the "WHERE" clause in which you use the primary key to identify the correct record to display.

Be aware of the fact that subforms are loaded before the parent form, which means you should let the recordsource update only be executed after the parent load event is finished otherwise you run into errors.(plenty of possible implementations for that)

you'll have a really little delay, caused by the database queries but I think that is acceptable, since the user has not the chance to enter anything wrong in that time.

Share:
16,389

Related videos on Youtube

WSK
Author by

WSK

Updated on September 15, 2022

Comments

  • WSK
    WSK over 1 year

    I've created split forms in my MS-Access 2013 application. They work well individually but when I open them through navigation form they appear as single in navigation subform. Tried many options but could not figure out what is going wrong.

  • WSK
    WSK over 10 years
    thanks @Renaud Bompuis for your suggestion. It would work for me. Could you explain it little bit more for me? as I couldn't find a datasheet control. Sorry for stupid questions
  • DHW
    DHW over 10 years
    You'd need to add two subform controls into your parent window. The first subform will hold the form side of the fake-split. The bottom subform will hold the datasheet side of the fake-split. The datasheet view is implemented using a subform control, but the subform's Source Object property is set to either a form (in datasheet view only) or the actual table itself, referenced in the Source Object property as table.<tablename>.
  • Antony Hatchkins
    Antony Hatchkins almost 7 years
    How to link those two tables so that when user selects an item in the db subform the corresponding item was displayed in the form subform? I've found a solution to link them using the txt field in the parent window, but it introduces a noticable delay which is undesirable. Or maybe @DHW can give a hint?
  • G.T.D.
    G.T.D. about 4 years
    +1 This should be the accepted answer as it gives the general outline of how to solve the original question.