How to remove a datasheet's subform view (1 Viewer)

coypu

Registered User.
Local time
Today, 19:53
Joined
Mar 12, 2019
Messages
26
Hi
I have some forms where I allow datasheet view. Those forms also have a tab control containing subforms.
When in datasheet view, there is a "plus" just to the right of the record selectors. If that is clicked, the first subform displays between the current datasheet record and the next.
My question is: how do I control which subform is displayed, and equally importantly can I prevent it displaying any subform? I.e. I only wish to see the subform when its parent is in form view, not datasheet view.

I appreciate this is different to a subdatasheet, as display of these subforms can't be prevented by using the menus: Home>Records>More,>Subdatasheet>Remove as that is disabled for these form's datasheet view.
 

Micron

AWF VIP
Local time
Today, 14:53
Joined
Oct 20, 2018
Messages
3,478
If I understand what you're describing, it's because of the subdatasheet property of the underlying table. Set it to [None] in the property sheet in design view and see if that solves your issue. So I'm suggesting you alter the property at the table level, not off of the ribbon.
how do I control which subform is displayed, and equally importantly can I prevent it displaying any subform? I.e. I only wish to see the subform when its parent is in form view, not datasheet view.
Not sure what these questions mean. You want to control/set the source object property of the subform control?
 

isladogs

MVP / VIP
Local time
Today, 19:53
Joined
Jan 14, 2017
Messages
18,209
Agree with Micron.
Using subdatasheets is a bad idea as :
a) they can be confusing for end users
b) they have to be loaded in addition to the main table which causes performance issues i.e. they slow down your app.
Many developers disable them permanently
 

coypu

Registered User.
Local time
Today, 19:53
Joined
Mar 12, 2019
Messages
26
Micron, thanks for the suggestion.
Parent form's recordsource is two linked tables joined. I made the change you suggest to both tables in both FE and BE. The subforms still appear unfortunately.


Colin
I quite understand and agree with your reservations about subdatasheets. This is slightly different but similar impact, and I'm looking for the way to prevent these subforms appearing.
 

isladogs

MVP / VIP
Local time
Today, 19:53
Joined
Jan 14, 2017
Messages
18,209
Can you post some screenshots? Design view & form/datasheet view
 

Micron

AWF VIP
Local time
Today, 14:53
Joined
Oct 20, 2018
Messages
3,478
What about the + you wanted to get rid of??
If you don't clarify or answer questions then I'm not going to be any more in tune with the problem than I was before.
Not sure what these questions mean. You want to control/set the source object property of the subform control?
 

coypu

Registered User.
Local time
Today, 19:53
Joined
Mar 12, 2019
Messages
26
Sorry Micron. Perhaps I should have said your suggestion made no difference i.e. the "plus" and subforms still appear.
 

coypu

Registered User.
Local time
Today, 19:53
Joined
Mar 12, 2019
Messages
26
Re: How to remove a datasheet's subform view?

Can you post some screenshots? Design view & form/datasheet view
Screenshot attached:

2019-03-20_1650.png
 

isladogs

MVP / VIP
Local time
Today, 19:53
Joined
Jan 14, 2017
Messages
18,209
That's still a subdatasheet but the subform is in single form view rather than datasheet view.
So please can you clarify what exactly you do want
 

isladogs

MVP / VIP
Local time
Today, 19:53
Joined
Jan 14, 2017
Messages
18,209
OK I did some investigating with a simple form / subform setup to try & make sense of this

If the subform is placed in the detail section, you will get a subdatasheet or subform (in its default state) for each record so you will see a + sign

In this setup, the main form can be single or datasheet but NOT continuous.
Similarly for the subform

However that's not the usual approach to use.
Normally you would place the subform in the footer section of the form

If the main form is a single form, you will see the subform filtered to the same record as the main form

For a continuous main form, the subform is filtered to the selected record but that may not be particularly clear to the end user

If the main form is a datasheet you won’t see the subform at all – because there is no header / footer section on a datasheet.
If so you may as well remove the subform

Hope that helps clarify what you need to do
 
Last edited:

coypu

Registered User.
Local time
Today, 19:53
Joined
Mar 12, 2019
Messages
26
Thanks Colin, as you advised, moving my subform from the parent's detail section to its footer section, solved it, so that is the answer I needed to "how to remove a datasheet's subform view".
 

isladogs

MVP / VIP
Local time
Today, 19:53
Joined
Jan 14, 2017
Messages
18,209
Hooray. Glad I could help.

But if its a datasheet main form, then why not remove the subform completely as you can't see it anyway.
Its still loaded in the background but it seems to me is serving no purpose.
 

coypu

Registered User.
Local time
Today, 19:53
Joined
Mar 12, 2019
Messages
26
I see my opening post did not make clear that the default view was single form, with datasheet being allowed. Apologies to all.

I find allowing users to switch between form view and datasheet view (caveat: when appropriate!) enables easy record navigation and filtering if needed, using the latter, then focus on the detail in the former. The control Access provides for what each view contains, now with my subforms no longer getting in the way of my datasheets thanks to your advice, seems ideal to me. Easy "wood or trees" solution AFAICS, with few effort or performance costs.
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 19:53
Joined
Jan 14, 2017
Messages
18,209
Interesting. I never allow end users to change views and in fact hardly ever use datasheets.
I tend to use either single or continuous forms with objects such as combos or option groups being used to filter data displayed
 

Users who are viewing this thread

Top Bottom