Best approach to continuous sub-forms

WorkingVBA

Registered User.
Local time
Today, 02:54
Joined
Jul 3, 2013
Messages
33
Hi,

This is more of a best approach question. I have been wrestling with this problem for a few days and would like to see if anyone can give me some ideas for a best approach before I spent too much time in development.

I have both a form and a report with continuous sub-forms. Presently, both the form and report are set up in single view with the continuous sub-forms in place. Everything works.

We are looking to make the form more flexible, thus the number of sub-forms and their content may vary at the time that the form or report are called. This would be a relatively simple thing to do if you could build a continuous form/report that had the ability to contain sub-continuous forms/reports. As I understand it this is not possible (MS Access restriction for whatever reason)

I know that it is possible to create a form/report while calling it using VBA. Thus in theory one might build a single form, adding the needed continuous sub-forms/reports to the form/report at the time it is called.

So here are the questions:
1. Am I on the right track here, or is there some other way to do this, I might not have considered? And,
2. If the latter approach (building the form with vba at the time it is called) is the best way, does anyone know of a good white paper or post that would show me how to do this (I am afraid that I have never done anything like this before)

NOTE: The above post describes creating embedded continuous forms and reports. You can do what I described in a report, but I need to replicate this flexibility for a form as well.

Thanks for your guidance, the help is much appreciated.
 
Last edited:
you are not correct.

you can have a continuous form, with a continuous subform - but access won't automate the link, so you have to do it yourself.

tiny bit of code.

base the subform on a query that uses the current record in the main form. that's all it takes. in the current event for the main form, have subformcontrol.requery
 
Thanks Gemma, I am going to give that a try. It never felt so good to stand corrected. I will post the results though that may take a little while.
 
I would stay away from building forms on the fly. I would use tabs and hide and show the tabs if the use of the subform depended on some mainform value.
 
Actually, there is a workaround for having a Subform when the Main Form is in Continuous View, and have Access do the linking. It requires that you put the Subform either in the Header or the Footer of your Main Form. To escape the wrath of the Access Gnomes you have to:

  • Create your Main Form in Single Form View
  • Place the Subform in Header or Footer, whichever you like
  • Save the Form
  • Now go into Properties and change the Main Form's Default View to Continuous View Form
Linq ;0)>
 
Linq,

I have read your suggestion in a few other places. One of the criteria for this solution is to be able to repeat the continuous subform for each of the records in the continuous main form. I don't think that would work if you placed the subform in the header or footer. But I appreciate your comments, and if I am wrong, do not hesitate to correct me. if this post proves anything it shows that I have been wrong about these things before. :)
 
Last edited:
...One of the criteria for this solution is to be able to repeat the continuous subform for each of the records in the continuous main form...

The solution I gave, it works just like any Main Form/Subform scenario; as you move from one Record to another Record, in the Main (continuous) Form, the Subform Records will update to be appropriate to that Main Form Record.

Linq ;0)>
 
Linq,
Yes, however I am looking to display all the subforms simultaneously for all the records in the source data (about 16 to 20). This is a very unusual setup, I know, but things are falling into place, in no small part due to the help of friends like you.

best,
 
you are not correct.
you can have a continuous form, with a continuous subform - but access won't automate the link

Dave,

How would you go about doing this? I get "A form with a subform object can't have it's DefaultView property set to Continuous Forms" error.
 

Users who are viewing this thread

Back
Top Bottom