show details on main form when you click on subform

siamandm
BronzeLounger
Posts: 1234
Joined: 01 May 2016, 09:58

show details on main form when you click on subform

Post by siamandm »

hello All
I have a main form and sub form both are connected to the same table and design as below:
Screenshot 2024-04-24 163437.png
I would like to show all the records on the sub form, and when i click one of them show its details on the main form

Regards
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: show details on main form when you click on subform

Post by HansV »

Select the table in the navigation pane.
Activate the Create tab of the ribbon.
In the Forms group, select More Forms > Split Form.
Once the form has been created, switch to design view and modify the design as desired.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: show details on main form when you click on subform

Post by HansV »

Alternatively: open the main form that you already have in design view.
Set the Default View to Split Form.
Lower down on the Property Sheet, set the Split Form Orientation to Datasheet on Bottom.
Best wishes,
Hans

User avatar
Gasman
2StarLounger
Posts: 105
Joined: 22 Feb 2022, 09:04

Re: show details on main form when you click on subform

Post by Gasman »

That is what I call an Emulated Split Form or ESF.

I created one for a DB of mine many years ago.

In the main form Open

Code: Select all

Private Sub Form_Open(Cancel As Integer)
    Me.RecordSource = "qryEmails"
    Me.sfrmEmails.SourceObject = "cfrmEmails"
    Set Me.sfrmEmails.Form.Recordset = Me.Recordset
 
sfrmEmails is the subform control

In this you do NOT link the master and child fields.

However that does not appear to be how Isladogs has done it.?

https://www.isladogs.co.uk/emulated-spl ... t%20works.
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.

siamandm
BronzeLounger
Posts: 1234
Joined: 01 May 2016, 09:58

Re: show details on main form when you click on subform

Post by siamandm »

Thank you Gasman and Hans, based on your replies an idea came to my mind... I have used a continues form only and I have added the fields again to the Form footer of the continues form as below :( so I liked to share this with you as well )
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: show details on main form when you click on subform

Post by HansV »

Good for you!
Best wishes,
Hans

siamandm
BronzeLounger
Posts: 1234
Joined: 01 May 2016, 09:58

Re: show details on main form when you click on subform

Post by siamandm »

Thank you for you all :)