Solved Split Form Open Problem When Opened with VBA or from Navigation Pane (1 Viewer)

Pac-Man

Active member
Local time
Today, 06:20
Joined
Apr 14, 2020
Messages
408
Hi,

I have a form with default view split form and form reading order of controls and form orientation is set to Right-to-Left. When the form is opened with double clicking in the navigation pane or by using DoCmd code, it layout changes and everything is disturbed on it and also form opened up as maximized and covering full screen. When it is switched to design view and and form view, it opens fine. I have tried everything I could think of but problem remains same. Can somebody help me out. Db is attached.

Best Regards,
Abdullah
 

Attachments

  • DoT.accdb
    4.5 MB · Views: 419

Galaxiom

Super Moderator
Staff member
Local time
Today, 12:20
Joined
Jan 20, 2009
Messages
12,849
Split forms suck. Best emulate it with subforms.
 

Gasman

Enthusiastic Amateur
Local time
Today, 01:20
Joined
Sep 21, 2011
Messages
14,048
Search for Emulated Split Form on this site if you decide to use a subform.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 01:20
Joined
Feb 19, 2013
Messages
16,553
check your form properties

you have the width set to 19.286cm and set auto centre, autoresize and fit to screen set to yes
 

Pac-Man

Active member
Local time
Today, 06:20
Joined
Apr 14, 2020
Messages
408
Thanks @CJ_London,

Setting to Auto Center to No fixed the issue. But I do agree with @Galaxiom and @Gasman that split forms are full of problems. I have seen "Duplicate Split Forms" in sample databases section. It is nice but the author of that DB is using 3 tables and lot of queries (which I'm not good at). Right now I am using split form but may be switch to that method (if stumble across another split form issue) when figured out how to use it for my case.

Best Regards
Abdullah
 

Gasman

Enthusiastic Amateur
Local time
Today, 01:20
Joined
Sep 21, 2011
Messages
14,048
Read the actual post.
I use what I call an ESF (Emulated Split Form) for one DB and this is all it is in the main form

Code:
Private Sub Form_Open(Cancel As Integer)
    Me.RecordSource = "qryEmails"
    Me.sfrmEmails.SourceObject = "cfrmEmails"
    Set Me.sfrmEmails.Form.Recordset = Me.Recordset
End Sub
 

Pac-Man

Active member
Local time
Today, 06:20
Joined
Apr 14, 2020
Messages
408
Read the actual post.
I use what I call an ESF (Emulated Split Form) for one DB and this is all it is in the main form

Code:
Private Sub Form_Open(Cancel As Integer)
    Me.RecordSource = "qryEmails"
    Me.sfrmEmails.SourceObject = "cfrmEmails"
    Set Me.sfrmEmails.Form.Recordset = Me.Recordset
End Sub
I'm referring to this demo db. I've not seen your db. I'll search and see it.
 

Gasman

Enthusiastic Amateur
Local time
Today, 01:20
Joined
Sep 21, 2011
Messages
14,048
My DB is not here. It is a DB I created to help me, but that is all it contains to have a main form and a subform (like a split form) which act in sync.
 

Pac-Man

Active member
Local time
Today, 06:20
Joined
Apr 14, 2020
Messages
408
Read the actual post.
I use what I call an ESF (Emulated Split Form) for one DB and this is all it is in the main form

Code:
Private Sub Form_Open(Cancel As Integer)
    Me.RecordSource = "qryEmails"
    Me.sfrmEmails.SourceObject = "cfrmEmails"
    Set Me.sfrmEmails.Form.Recordset = Me.Recordset
End Sub
Dear @Gasman, I can't believe it is that much easy. Thanks for the code. I have successfully implemented it. It is very easy and trouble free. Although I am having little trouble hope I'll get it resolved here. When I was using split form, I had successfully implemented the filter method as discussed in my this post. However, when I switched to ESF, I'm having following issues:
  1. This filter method won't work anymore, may be it needs little tweaking or fixing.
  2. When I filter using the column header of subform (which is in datasheet view), sync between main form and subform stopped working. Whatever I do after, like clear filter, won't fix the issue.
Can anybody please help me fix this issue.
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 01:20
Joined
Sep 21, 2011
Messages
14,048
I have not had need to apply a filter, but I would have thought you would just reapply the recordset line, so the ESF has the same as for the main form.?
Also vice versa if you filter the ESF ?
 

isladogs

MVP / VIP
Local time
Today, 01:20
Joined
Jan 14, 2017
Messages
18,186
The example emulated split form in my link includes a filter
It is exactly the same app as the final version in the thread on this forum that Gasman linked.
If you read that thread, you will see it went through several iterations with contributions from several other AWF members
 

Pac-Man

Active member
Local time
Today, 06:20
Joined
Apr 14, 2020
Messages
408
I have not had need to apply a filter, but I would have thought you would just reapply the recordset line, so the ESF has the same as for the main form.?
Also vice versa if you filter the ESF ?
How to reapply the recordset code when I apply filter from column header? Any suggestion?
 

Pac-Man

Active member
Local time
Today, 06:20
Joined
Apr 14, 2020
Messages
408
I would look to see how Isladogs did it?
I agree with you but actually @isladogs have not used subform in his db instead he used continuous form in main form detail section while in form jeader he emulated emulated the single form. I tried using the recordset code in "on apply filter event" of main form but it was not triggering because main form is not being filtered but subform is. I inserted the code in subform "on apply filter" event. It was being triggered and syncing the two forms but filter was getting cleared i.e. filter was not being applied.
 

isladogs

MVP / VIP
Local time
Today, 01:20
Joined
Jan 14, 2017
Messages
18,186
I made the ESF like that precisely so it emulates the built in split form but with none of its disadvantages.
If you want a split form arrangement, why not use that layout and look at how my combo box in the header section filters the form?

If you just want a form and subform, it is a very common solution.
As a result, there are numerous examples on this forum and elsewhere which demonstrate how to filter the subform.
 

Users who are viewing this thread

Top Bottom