Go Back   Access World Forums > Microsoft Access Reference > Sample Databases

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-25-2017, 04:56 AM   #1
ridders
AWF VIP
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 2,923
Thanks: 54
Thanked 686 Times in 634 Posts
ridders has a spectacular aura about ridders has a spectacular aura about
Emulating the split form

Like many users of this forum, I abandoned split forms a long time ago as I found them difficult to adapt if you want to modify them in any way

In a recent thread another user wanted to keep the idea but to emulate it using a single form with a continuous subform. See this thread:
https://www.access-programmers.co.uk...d.php?t=293854

I referred him to this post by @speakers_86.
https://www.access-programmers.co.uk...d.php?t=284896
This works but the OP found the code quite complex.

A MUCH simpler solution was then provided by @MarkK and he has given permission for me to publish it to the sample databases area.

I can't take any credit for the code which needs just 4 lines in the Form_Open event of the main form:

Code:
Private Sub Form_Open(Cancel As Integer)
'   This is the main form open event handler
    Me.RecordSource = "tTestData"            'set the recordsource of the main form
    Me.sfm.SourceObject = "fTestDataDS"      'load datasheet subform w/ blank RecordSource
    Set Me.sfm.Form.Recordset = Me.Recordset 'set subform recordset to same object as main form's
End Sub
NOTE:
Make sure that you DON'T link parent & child fields for the form & subform

As an example, I've created a very simple db to show how it works.
The emulated split form frmForumPosts opens when you run the db

For comparison, it also contains a 'real' split form : frmForumPostsStandardSplitForm

NOTE:
As the title implies, I created the example db 'ForumPostReference' in order to save a record of forum posts at AWF, UA etc so I can refer back to them in the future.

Ideally I'd just save the details of my subscribed threads as a CSV file but that's not currently available (though you can do that for private messages!)

I'm going to add that as a site suggestion ....
Attached Files
File Type: accdb ForumPostReference.accdb (588.0 KB, 176 views)

__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
, Tapatalk


If this answer has helped, please click the Thanks button and/or click the 'reputation' scales symbol on the left and leave a comment. Cheers!

Last edited by ridders; 06-25-2017 at 08:47 AM.
ridders is offline   Reply With Quote
Old 08-06-2017, 06:20 AM   #2
ridders
AWF VIP
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 2,923
Thanks: 54
Thanked 686 Times in 634 Posts
ridders has a spectacular aura about ridders has a spectacular aura about
Re: Emulating the split form

Attached is an updated version of the emulated split form database.

This includes code to highlight the selected row in the continuous form section.



Many thanks to @arnelgp for coming up with a simple solution to the challenge of coding this in response to the question posed in this thread
https://www.access-programmers.co.uk...d.php?t=295085

EDIT:
With standard split forms, it is impossible to hide selected columns in the datasheet section of the form
With the emulated split form, that isn't a problem
Attached Images
File Type: png Capture.PNG (26.5 KB, 595 views)
Attached Files
File Type: accdb EmulateSplitForm v3.accdb (544.0 KB, 75 views)
__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
, Tapatalk


If this answer has helped, please click the Thanks button and/or click the 'reputation' scales symbol on the left and leave a comment. Cheers!

Last edited by ridders; 08-08-2017 at 12:18 PM. Reason: Extra info
ridders is offline   Reply With Quote
Old 09-12-2017, 09:14 AM   #3
NauticalGent
Pristine Curmudgeon
Gold Supporter
 
NauticalGent's Avatar
 
Join Date: Apr 2015
Location: Naples, Italy (EXPAT from Virginia)
Posts: 1,058
Thanks: 239
Thanked 135 Times in 123 Posts
NauticalGent will become famous soon enough
Re: Emulating the split form

Kudos to @Ridders, @MarkK and @Arnelgp for this very practical and useful post. I can on plagiarizing the bit to the highest level of plagiariztivity...

__________________
...see, what had happened was...
NauticalGent is offline   Reply With Quote
Old 10-01-2017, 02:33 AM   #4
ridders
AWF VIP
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 2,923
Thanks: 54
Thanked 686 Times in 634 Posts
ridders has a spectacular aura about ridders has a spectacular aura about
Re: Emulating the split form

Some significant problems have been reported with the emulated split form.
AFAIK the problems only affect Access 2007 users.

See this rather lengthy thread: https://www.access-programmers.co.uk...d.php?t=295803

In an attempt to deal with the reported issues, various changes have been made and alternative approaches suggested.
Version changelog attached for anyone who is interested

It seems to be impossible to create one version of the ESF that includes all features and works in all versions of Access.
Perhaps that is why the official MS split form itself has flaws....!

Anyway, attached to this are 2 versions as follows
These look very similar & mostly behave in the same way.
Please use/adapt whichever you prefer or works best for you



Version 10A
Based on the original idea suggested by MarkK using a subform and linked recordsets
This uses a continuous subform - a datasheet version is also supplied as an alternative if preferred
Either version of the subform can be sorted by clicking on any of the column headers
Includes current record highlighting and record filtering.

Issues
Updating the checkbox requires two clicks when moving to a new record
Errors reported for at least one A2007 user
Occasionally triggers error 2105 if next or previous button clicked repeatedly very fast


Version 10S
Based on a different approach suggested by Static
All controls in the same form so no need for linked recordsets
MUCH simpler code than version 10A so easier to adapt by others
This SHOULD work in ANY version of Access AFAIK
Sorting and record filtering as for version 10A

Issues:
Record highlighting removed as it didn't work properly
Same error 2105 issue can occur as for version 10A

NOTE: Full error trapping code has not been done in either version

Many thanks to others who've conributed to this topic
Particular thanks to MarkK, arnelgp & Static for their suggestions & to Gasman for providing feedback on A2007

I am intending this to be my final contribution to this topic.
However, I would be only too pleased for others to take this on and develop the idea further ....

Personally I NEVER use split forms - and that also applies to the emulated version!!!!
Attached Images
File Type: png ESF.PNG (31.0 KB, 438 views)
Attached Files
File Type: txt VersionInfo.txt (2.0 KB, 77 views)
File Type: zip EmulateSplitForm v10A.zip (55.6 KB, 53 views)
File Type: zip EmulateSplitForm v10S.zip (45.9 KB, 52 views)
__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
, Tapatalk


If this answer has helped, please click the Thanks button and/or click the 'reputation' scales symbol on the left and leave a comment. Cheers!

Last edited by ridders; 10-01-2017 at 01:40 PM.
ridders is offline   Reply With Quote
The Following User Says Thank You to ridders For This Useful Post:
Gasman (10-01-2017)
Old 10-01-2017, 03:26 AM   #5
Gasman
Access newbie
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 1,609
Thanks: 204
Thanked 226 Times in 212 Posts
Gasman will become famous soon enough Gasman will become famous soon enough
Re: Emulating the split form

Thank you for all your hard work Colin.
I will certainly be using what I now call an ESF more in the future, especially for the sort feature that is available.
__________________
Access novice. Sometimes trying to give something back.
Access 2007
Gasman is offline   Reply With Quote
Old 10-02-2017, 11:11 AM   #6
static
Newly Registered User
 
Join Date: Nov 2015
Posts: 726
Thanks: 3
Thanked 172 Times in 164 Posts
static will become famous soon enough static will become famous soon enough
Re: Emulating the split form

So, I decided to have a look at record highlighting. (mostly because I never used conditional formatting before and wanted to know how it was done.)

The highlight is a single locked textbox.
It uses similar conditional formatting as the other versions, except the condition value comes from a hidden textbox in the header.

I believe I also fixed the 2105 error by using movenext on the recordset instead of gotorecord.

EmulateSplitForm v10S.accdb
static is offline   Reply With Quote
The Following User Says Thank You to static For This Useful Post:
ridders (11-18-2017)
Old 11-18-2017, 03:24 PM   #7
ridders
AWF VIP
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 2,923
Thanks: 54
Thanked 686 Times in 634 Posts
ridders has a spectacular aura about ridders has a spectacular aura about
Re: Emulating the split form

Apologies for the time its taken to respond to this post.
First of all it disappeared into moderator limbo for a few weeks and for some reason , it doesn't show the number of downloads.

BUT I think you've nailed it. Well done.
I tried to break it and am pleased to say I failed.
It all seems to work flawlessly

A very minor quibble is that if you click on a field on the highlighted record, the highlight changes colour but you could say that's a good thing anyway.

Job done. Why haven't others been on here to thank you?


__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
, Tapatalk


If this answer has helped, please click the Thanks button and/or click the 'reputation' scales symbol on the left and leave a comment. Cheers!

Last edited by ridders; 11-19-2017 at 09:20 AM.
ridders is offline   Reply With Quote
Reply

Tags
split form emulation

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
emulating a stored procedure toddbailey Modules & VBA 4 03-12-2012 07:53 AM
Split string, execute function, delete split. Dranoweb Modules & VBA 30 11-03-2010 09:56 PM
Emulating a crosstab query in SQL DCrake SQL Server 2 07-22-2008 08:28 AM
Emulating Notes View CaptainBalrog Queries 3 02-16-2006 08:15 AM
[SOLVED] emulating xbase grid on access form halvo1 Forms 0 09-02-2003 09:45 PM




All times are GMT -8. The time now is 02:05 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World