subform

  • Thread starter Thread starter Joel Allen
  • Start date Start date
J

Joel Allen

Hello,

In the main form and a subform. When I select the record in the subform, I
want to display the same record in the main form, or vice versa. Can
someone point me in the right direction or send me an example?


Thanks very much,
Joel
 
If you really want to do this, make sure the subform has nothing in its
LinkMasterFields and LinkChildFields properties. You may then be able to use
some code in the Current event of the subform to FindFirst in the
RecordsetClone of the main form, and set the Bookmark.

I'm not convinced this is a great idea though. There are several pitfalls.
For example:

- It may not work the same across different versions of Access.

- There can be concurrency issues between the main and subform.

- You have to constantly Requery the other (to see the
changes/inserts/deletes) and then find your place again.

- If you don't get the LinkMasterFields/LinkChildFields cleared:
o The subform inherits the link field values from the subform.

o That not only fails when you try to insert a new record;
it also messes with the Seed of the AutoNumber,
so no new records can be added.

o You can finish up in an endless loop, where the subform's
Current event moves the main form, which triggers the
subform's Current event again, which moves the main ...

If you are using Access 2007, you could just use a form in Split view.

It might be easier to use a listbox (rather than a subform) for the
navigation part.
 
Back
Top