Split Forms

One code issue with split forms has just been reported. They don't currently support the code context object

Open a split form and add this code to the Form_Load event:
Code:
Debug.Print Now, "CodeContextObject", (CodeContextObject Is Nothing)

Run the form, and you will get error 2467: The expression you entered refers to an object that is closed or doesn’t exist.

Open any type of form and the code runs without issues
The split form error has been reported as a bug

I looked at post #11 and couldn't find any link mentioned. Just fixed the broken link you did mention in post #32

Currently writing up post #38 as a new web article & will modify the two earlier articles to remove duplication
Sorry, my mistake. I meant #32 not #11.

Thanks for additional info.
 
Just uploaded my article:

Thanks for prompting me to do so. Whilst doing so, I discovered a few new things about split forms - both good but (mainly) bad
 
Last edited:
Run the form, and you will get error 2467: The expression you entered refers to an object that is closed or doesn’t exist.

Open any type of form and the code runs without issues
The split form error has been reported as a bug
@isladogs Is it a code limitation or a bug?
Because if it's a split form limitation, it's not a bug. It's what their object model is and how it's designed.

On the other hand, if it's a bug, I don't think it's fair to be mentioned under code limitation or disadvantage. They will correct it in an update just like any other bugs that have been found.
We don't consider other bugs in different updates as code limitation.

Thank you.
 
I assumed it was a limitation in the object model in the same way as placing object is the footer section is a limitation.
It has (probably) always existed since split forms were introduced in 2007

However, today it was suggested by another MVP that it may well be a bug. My comment reflected that.
Whether that means it can or will be fixed ... soon or ever... is another matter. Watch this space

I am aware of several other bugs dating back even further that are known to MS but will probably never be fixed for a variety of reasons.
Not there by design but difficult to put right as doing so may break backward compatibility
 
For your enhanced continues split form, why do you need a subform? I can create a continuous form and copy and paste the exact controls to the header. It behaves like a split form. I can add, delete & edit a record both from the single and continues section.

Yes you can simulate a split form with e.g. a single form in the header and a continuous form below. The advantage is it needs no code to stay in sync. A minor disadvantage is the record highlighter feature covers the first row if the columns are sorted by the header. Replacing with a record selector solves that.
I just wanted to report back we had to change our path.
As I suggested above, we used an enhanced split form without subform. We made a continuous form and added the exact fields as controls in the header of the form. It gave us an split form without having a subform.

Working with this form was much easy, because it was a continuous form in a single form. Referencing controls, moving between records, codes were shorter. It was much easier to work in a single form than having a subform. Very fast and easy to use.

There was a major problem that we couldn't solve. When the count of shown records in continouse form was more than a page, we couldn't scroll the form with mouse wheel. We had to grab the vertical scroll bar and drag it up and down to see previous or later records. this, in turn caused a lot of flickering that we couldn't solve.

We are now following @isladogs and @GPGeorge advice and using a sub form in a single form to enhance a split form. It's much stable and mouse wheel works just fine in the subform, plus no flickering when moving between records in continuous form.

Not that I doubted your knowledge and experience, but sometimes one need to feel the problem to understand it.
We really appreciate all given advices on split forms specially those given by @isladogs, @GPGeorge & @Galaxiom .
 

Users who are viewing this thread

Back
Top Bottom