isladogs
Access MVP / VIP
- Local time
 - Today, 05:55
 
- Joined
 - Jan 14, 2017
 
- Messages
 - 19,297
 
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/forums/showthread.php?t=293854
I referred him to this post by @speakers_86.
https://www.access-programmers.co.uk/forums/showthread.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:
	
	
	
		
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 ....
 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/forums/showthread.php?t=293854
I referred him to this post by @speakers_86.
https://www.access-programmers.co.uk/forums/showthread.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 ....
Attachments
			
				Last edited: