Solved

Form.Subdatasheet Expanded - No expansion if no child records?

Posted on 2006-10-23
7
1,342 Views
Last Modified: 2010-10-05
I have a subdatasheet/form that I'd like to automatically expand only when there are child records.  Does anyone know of a way to do this, maybe in code?  Form.Subdatasheet Expanded set to 'Yes' expands all of them...
0
Comment
Question by:WorthN
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 18

Accepted Solution

by:
Data-Man earned 300 total points
ID: 17790117
you can use this command to expand the sub datasheet view

docmd.RunCommand acCmdSubdatasheetExpandAll

You'll have to test for data first and then run the code.

Mike
0
 

Author Comment

by:WorthN
ID: 17790153
That was fast! Thanks.

This expands all SubDataSheets...  I'd like it to only expand the SubDatasheet if there is a child record.  Otherwise I get this unreadable mess with every parent record displaying sub record with new record line and headings.

Cheers
0
 
LVL 26

Assisted Solution

by:dannywareham
dannywareham earned 200 total points
ID: 17790170
Check the number of records:

(Air code)

If me.subsheetname.form.recordcout >0 then
docmd.RunCommand acCmdSubdatasheetExpandAll
End if
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 18

Expert Comment

by:Data-Man
ID: 17790184
Sorry, the it's either ExpandAll or CollaspeAll.

I no of no way to expand a single record.  

However, it there is a will there is a way.

Mike

0
 

Author Comment

by:WorthN
ID: 17790189
Thanks...  I'll give that a go.
0
 

Author Comment

by:WorthN
ID: 18156751
Just an FYI...  I'm still looking for a solution to this in case anyone comes across the answer.

Cheers!
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question