Emulated split form problem (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 20:27
Joined
Sep 21, 2011
Messages
14,047
Hi all,
I have started to use the emulated split form where possible in my databases.
The way it works is shown in this thread.

https://www.access-programmers.co.uk/forums/showthread.php?t=294421

I have a few problems with it, that I can live with for now.
1. I am unable to select a different record some times until I use the record selector as opposed to just selecting a control.
2. When going to form view from design view I get error 2455 on the line shown in 2455-2 pic. If I End and try again it works fine, and does so for the most part. Obviously when running the user will not have design mode, but I would still like to know what my mistake is.

However I have just discovered that if I try and edit a record in the emulated splitform, I get the message in Emulated Splitform pic.

I tried the same on Ridders latest sample db with this with the same result.?
I would like to be able to use the datasheet as a normal datasheet if at all possible, just for ease of update on most occassions.

Is anyone able to offer ideas on how to achieve this please.?

TIA
 

Attachments

  • Emulated Split Form.PNG
    Emulated Split Form.PNG
    8.2 KB · Views: 199
  • 2455.PNG
    2455.PNG
    36.8 KB · Views: 209
  • 2455-2.PNG
    2455-2.PNG
    10.3 KB · Views: 190

isladogs

MVP / VIP
Local time
Today, 20:27
Joined
Jan 14, 2017
Messages
18,186
I've just checked the most recent version (v3) that I posted to the forum on 6 Aug

None of the issues you reported occurred for me (Access 2010 32-bit)

If you want to upload your problem split form, i'll have a look at it
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 20:27
Joined
Sep 21, 2011
Messages
14,047
Hi Colin,

I have your DB V3 as well.
Are you saying that you can edit any of the controls in the subform with 2010?
I only have 2007.

I've just checked the most recent version (v3) that I posted to the forum on 6 Aug

None of the issues you reported occurred for me (Access 2010 32-bit)

If you want to upload your problem split form, i'll have a look at it
 

isladogs

MVP / VIP
Local time
Today, 20:27
Joined
Jan 14, 2017
Messages
18,186
Yes ... IN THE TOP HALF of the form

You're right about the CancelUpdate error when trying to edit a record in the continuous form section. Not sure whether its solvable

I realise you can edit both halves in the 'proper' split form but as you know that has lots of issues

I THINK the issue is caused by the fact that the 2 halves of the form are deliberately not linked with master/child fields. That's necessary to ensure all records appear in the continuous section.

A recordset is used to display the data in the main form which means you can't edit the subform

I tried changing it to recordset.clone - it then allows editing in the subform but its not updated in the top half.

I then tried requerying the main form but that gives a new error

As I never use split forms ... including my own emulated version ... I'm going to leave it for now

HTH
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:27
Joined
Sep 21, 2011
Messages
14,047
Thank you Colin,

At least I am not going mad :)
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:27
Joined
Sep 21, 2011
Messages
14,047
I've just tried the form in my SSAFA database at home that is based on this logic, and whilst I still cannot edit any data in the subform, I do not get the error. ?
As the subform is really only used in this DB for selecting, that is not an issue.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:27
Joined
Sep 21, 2011
Messages
14,047
Colin,
I was getting that 'stuck on a record' in the subform again this morning.
I amended your DB to make it a datasheet (as are mine) and can replicate the problem.?

If you have any time, would you be able to give it a look please.?

It doesn't happen all the time, so you will need to pretty much click in the subform randomly until it does. Should not take long.
To get past it then select the record selector. Even the vcr buttons on the bottom do not work.

TIA
 

Attachments

  • EmulateSplitForm v3.accdb
    616 KB · Views: 188

jdraw

Super Moderator
Staff member
Local time
Today, 16:27
Joined
Jan 23, 2006
Messages
15,364
?? I downloaded the sample.
If I edit any field in the top half, move the record selector forward, then back, the edit shows in both top and bottom.

I do get the error below when attempting to edit in the bottom half.

Update or CancelUpdate without addNew or Edit
 
Last edited:

Minty

AWF VIP
Local time
Today, 20:27
Joined
Jul 26, 2013
Messages
10,355
I'm guessing it's because you have the same recordset effectively open twice, and one has to take precedence over the other.
 

jdraw

Super Moderator
Staff member
Local time
Today, 16:27
Joined
Jan 23, 2006
Messages
15,364
Minty,
I agree that's why I moved off the record to "save the edit" and back to re-establish the sync in the 2 forms.

My thinking is there may be a way to include a button with a click event to do the movements and effect the edits.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:27
Joined
Sep 21, 2011
Messages
14,047
I could not get it to stick on a record with Colin's DB when it was a continuous form though.:confused:
 

isladogs

MVP / VIP
Local time
Today, 20:27
Joined
Jan 14, 2017
Messages
18,186
Hi all

I've had another look at this and made some changes in the light of recent comments
There are 2 versions attached:

Version 4
a) the subform is now a datasheet rather than a continuous form

b) after editing a field in the top half it automatically does the following using an UpdateChanges procedure
- turns off screen updating
- moves to the next record
- moves back to the previous record
- moves to the next field
- turns on screen updating
Result: Both halves of the form update synchronously

c) I did exactly the same to the lower half and it can SOMETIMES be edited without the 'Update or CancelUpdate without addNew or Edit' error
For anyone who cares this is error 3020

The error is due to the way the recordset has been used in this emulated form.
I haven't been able to isolate it effectively but perhaps someone else will see how to do it.

This link may be of interest/use:
https://stackoverflow.com/questions/4228705/ms-access-update-or-cancelupdate-error-using-find-dialog

In my view this is too unreliable for use as it stands so ...

Version 5
Exactly the same as version 4 but I've LOCKED the subform
That 'fixed' it ...

I've not removed the code from the subform though it is redundant in this version

======================

Anyway, could others please test both versions and see what they think
Please feel free to improve on it - I won't be offended!

I'm going to 'blame' Mark K for coming up with this form in the first place! :D

No I'm not really ...
However, I have sent him a PM so he is aware of the issues and may perhaps come up with a solution
 

Attachments

  • EmulateSplitForm v4.accdb
    564 KB · Views: 178
  • EmulateSplitForm v5.accdb
    536 KB · Views: 188
  • VersionInfo.txt
    736 bytes · Views: 163

jdraw

Super Moderator
Staff member
Local time
Today, 16:27
Joined
Jan 23, 2006
Messages
15,364
I like the v5 UpdateChanges.
That is exactly the intent I suggested in my response to Minty in post #12.
Colin has done it on the afterUpdate and locked the subform. Great stuff.
 

isladogs

MVP / VIP
Local time
Today, 20:27
Joined
Jan 14, 2017
Messages
18,186
You should take the credit ... you gave me the idea
Once I get more feedback, I'll put an updated version in sample databases

And, just for you Jack, I included a versioninfo.txt file :)

P.S. The strange thing is I thought I had checked all of this before releasing it.

Its already been downloaded 147 times (v1+v3)
Odd that its taken 6 weeks before anyone picked up the problems ...
 

jdraw

Super Moderator
Staff member
Local time
Today, 16:27
Joined
Jan 23, 2006
Messages
15,364
You knew how to do it "painlessly". I probably would have created a button and had it debugged in a few days---nothing like cluttering up the interface and flow.

I'm glad people are downloading/using it. I can't explain the 6 weeks. I have had posters ask a question of a "somewhat dormant" thread (a year or more after the original)???
 

MarkK

bit cruncher
Local time
Today, 13:27
Joined
Mar 17, 2004
Messages
8,178
Seriously though, I don't see a way around that 'Update or Cancel Update without AddNew or Edit' error, apart from denying edits in the subform. Drag.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:27
Joined
Sep 21, 2011
Messages
14,047
Colin,

I like your highlight row in the subform. I've tried to implement it on one of my emulated forms, but it does not work.

I've added the test of
Forms![frmClient]![ClientID]=[ClientID] in the Conditional Format screen

When I open the form it highlights the first row, but when I select another row, the first stays highlighted and not the new row.
I saw you have a Me.Recalc in the Current event, so I tried that, but that hangs my Access.:banghead: I have no controls to actaully recalc.?

What step have I missed for this to work?

TIA
 

Users who are viewing this thread

Top Bottom