Show a form inside a datasheet, yes it's possible! (1 Viewer)

MsAccessNL

Member
Local time
Today, 23:39
Joined
Aug 27, 2022
Messages
184
1709195514968.png
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:39
Joined
May 7, 2009
Messages
19,247
please, share us your code..
 

MsAccessNL

Member
Local time
Today, 23:39
Joined
Aug 27, 2022
Messages
184
You can insert any form you want. It can also be a continuous form, another table or Query. It's not necessary that the table or query is linked to the main datasheet table/query.

Make a datasheet form (i used the wizard for this test)
You select the controls in design view, right click select layout > tabular. Right click on the first control, right click > Insert Below > Click on the empty cell > Properties > SourceObject and select any form, table, query you want.

Have fun with it.

You can do this also by code, but I just made this discovery a few minutes ago. May be you can post some usefull usage of this trick.
 

Attachments

  • Datasheet.PNG
    Datasheet.PNG
    47.9 KB · Views: 26

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:39
Joined
May 7, 2009
Messages
19,247
i can't make it work, i am using A2021?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 17:39
Joined
May 21, 2018
Messages
8,554
@MsAccessNL
I do not get it. People seem to hate the concept of the sub datasheet because they say it is confusing. Same people using table lookups, multi value fields, and other really confusing things. I use a lot of Treeviews so to me it is a simple way to build a treeview. So on a related note if you do some simple formatting it comes out pretty useable. Suprising the concept has not caught on.

sub.png
 

Edgar_

Active member
Local time
Today, 16:39
Joined
Jul 8, 2023
Messages
435
I might be wrong, but all you have to do is go into design view for a datasheet form and add a subform there.

Or is there something I'm missing?
 

Attachments

  • ACCtesting111.accdb
    1.2 MB · Views: 29

tvanstiphout

Active member
Local time
Today, 14:39
Joined
Jan 22, 2016
Messages
231
We ran into this with Northwind 2 Dev Edition, Employees form.
That one is a Split form, but same thing: a subform on the design surface turned into a subdatasheet.
 

Edgar_

Active member
Local time
Today, 16:39
Joined
Jul 8, 2023
Messages
435
I'm not a fan of datasheet views, but there's the possibility of making the subform lazy load the data to avoid the performance issues, maybe by making the subform empty by default and adding the data source dynamically only when needed. That'd be interesting to test.

I just remembered some users have posted threads about wanting to embed subforms in continuous forms, I've suggested reports inside reports, but this approach seems to be another option that does not deal with the limitations of reports. Instead, it will deal with the limitations of datasheet views, but with added benefits like having a recordset.
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 22:39
Joined
Jan 14, 2017
Messages
18,246
You can embed subforms in continuous forms but only in the header or footer section
 

Users who are viewing this thread

Top Bottom