Form Flickering after set recordsource (1 Viewer)

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
Hello everyone

I have complicated form with MainFrm and three sub-forms. One of them names SubFrmTable which is continuous form

Code:
        SQL = "SELECT DATATABLE.* " _
            & "FROM DATATABLE" _
            & "WHERE DATATABLE.Deleted = False " _
            & "ORDER BY DATATABLE.Createddate DESC;"
        Forms!MainFrm.Form!SubFrmTable.Form.RecordSource = SQL
       ' Commented out below line
        ' Forms!MainFrm.Form!SubFrmTable.Form.Requery

I have 2 questions that would need you help to advise:
1. After set recordsource as above, the forms are flickering crazy, especially when that SQL string returns many records. How to avoid this flickering issue? I have tried to set SubFrmTable visible property to No, then Yes again during RecordSource is being set, also tried to use Application.Echo but the issue remains.
2. Do I need to call Forms!MainFrm.Form!SubFrmTable.Form.Requery to force the form update new datas? If call this line, the flickering is even more

Appreciated your advices
 

June7

AWF VIP
Local time
Today, 01:34
Joined
Mar 9, 2014
Messages
5,423
Need a space after DATATABLE so doesn't run into WHERE.

Instead of setting RecordSource, could set form Filter and OrderBy properties.
 

bob fitz

AWF VIP
Local time
Today, 09:34
Joined
May 23, 2011
Messages
4,717
Have a look at the "similar threads" list at the bottom of this thread
 

Rene vK

Member
Local time
Today, 10:34
Joined
Mar 3, 2013
Messages
123
I use the call like this: (ClientScreen is the SubForm, ClientInfo is the form in it)
Code:
SQLstring = "SELECT * FROM Mz_Klanten WHERE KlantNr = '" & Me.kze_Klantnaam & "'"
With Me![ClientScreen]
If .SourceObject <> "ClientInfo" Then
.Visible = False
.BorderStyle = 0
.SourceObject = "ClientInfo"
.Form.RecordSource = SQLstring
.Form.Section(acFooter).Visible = False
.Form.FilterOn = True
.Form.AllowEdits = False
.Visible = True
Else
.Visible = False
.BorderStyle = 0
.Form.RecordSource = SQLstring
.Form.Section(acFooter).Visible = False
.Form.FilterOn = True
.Form.AllowEdits = False
.Form.Requery
.Visible = True
End If
End With
 

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
Need a space after DATATABLE so doesn't run into WHERE.

Instead of setting RecordSource, could set form Filter and OrderBy properties.
Thank you,
Yes, in fact I have a space before WHERE.
I will study about Filter (actually, I have never used form's Filter),
Could you please also advise, If I apply filter to my form, these action/check such record count, move next, move last...will still base on whole table records or only filtered records?

Best regards,
 

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
I use the call like this: (ClientScreen is the SubForm, ClientInfo is the form in it)
Code:
SQLstring = "SELECT * FROM Mz_Klanten WHERE KlantNr = '" & Me.kze_Klantnaam & "'"
With Me![ClientScreen]
If .SourceObject <> "ClientInfo" Then
.Visible = False
.BorderStyle = 0
.SourceObject = "ClientInfo"
.Form.RecordSource = SQLstring
.Form.Section(acFooter).Visible = False
.Form.FilterOn = True
.Form.AllowEdits = False
.Visible = True
Else
.Visible = False
.BorderStyle = 0
.Form.RecordSource = SQLstring
.Form.Section(acFooter).Visible = False
.Form.FilterOn = True
.Form.AllowEdits = False
.Form.Requery
.Visible = True
End If
End With

Thank bro, let me study and try
 

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
Have a look at the "similar threads" list at the bottom of this thread
Yes sir, I have tried to study before posting this thread. Anyway, I will study more carefully.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:34
Joined
May 7, 2009
Messages
19,169
check if there are Overlapping controls on the subform.
 

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
check if there are Overlapping controls on the subform.
Yes bro, in order to highlight current record of continuous form, I place a empty yellow rectangle behind form's controls, according this guide:
However, I removed this retangle, the issue still remains
 

June7

AWF VIP
Local time
Today, 01:34
Joined
Mar 9, 2014
Messages
5,423
Move next, move last only on filtered recordset of form.

If you want to provide db for analysis, follow instructions at bottom of my post.
 

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
Move next, move last only on filtered recordset of form.

If you want to provide db for analysis, follow instructions at bottom of my post.
Yes sir, the db is attached.
Due to some sensitive reason, I have set password for zip file: Test@db
Please help to investigate the flickering issue, also your comments to improve my db design are highly appreciated

Thanks,
 
Last edited:

June7

AWF VIP
Local time
Today, 01:34
Joined
Mar 9, 2014
Messages
5,423
Anyone can download file so what purpose does password serve? I can't even extract the file. If file has sensitive data, then make a copy and remove data.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:34
Joined
May 7, 2009
Messages
19,169
i don't see any flicker, i have i-7 7th gen.
 

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
Anyone can download file so what purpose does password serve? I can't even extract the file. If file has sensitive data, then make a copy and remove data.
Sorry for incovenience caused. I have removed the password, could you please try again?
They are non-english db, I hope you guy still can open and analysis the design.
 

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
i don't see any flicker, i have i-7 7th gen.
Hi Bro, please click on tab buttons, this time the recordsource of
SubFrmTable is reset. These should be flickering happen this moment. Then click on filter button ("Loc", or "Tat ca DT") on left panel to show all record, it will be flickering too
 

Rene vK

Member
Local time
Today, 10:34
Joined
Mar 3, 2013
Messages
123
Man, forget my post (no-4) I am trying to fit it in.... That is hard to do.
the flickering is because of the coloring. Try to toggle the visibility of the subform in the manner I showed, maybe that will help.

I know it is not much of an answer, but I try to manage your coding but am not getting far.
 

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
i don't see any flicker, i have i-7 7th gen.
What is your MS office version?
Mine is 365,
Both of my PC and Laptop are with core i5 CPU, and both have same issue.

I have tried to not change the recordsource according post #2 becoz I also thought when recordsource is changed, Access will auto does some refresh form's data and its controls that would make flickering. So, I first load all data to the form, then apply the form filter such :
Code:
    SQL_TblFilterStr = "Type = '" & TypeDT & "' AND " _
                        & "MADT in (SELECT " _
                                    & Tblname & ".MADT " _
                                    & "FROM " & Tblname & " " _
                                    & "WHERE " _
                                    & SubSQLCriteria & " )"

        SQL_FilterStr = SQL_TblFilterStr & SQL_TypeFilterStr
        Forms!MainFrm.Form!SubFrmTable.Form.Filter = SQL_FilterStr

Sadly, the issue insists there...

Update: I made an empty Navigation Control form, no any underlaying data, insert a picture and an unbound text box, a label. Click on tab1, tab2... randomly the mysterious flicker occurs unpredictable, yep... it is there
 
Last edited:

Babycat

Member
Local time
Today, 16:34
Joined
Mar 31, 2020
Messages
275
Changing SourceObject of subform also creates a lot flicker
I have made a very simple db, and record the video too,
Anyone help to comfirm me if the issue also happen on your machine?
 

Attachments

  • Flicker.zip
    1.7 MB · Views: 178

Users who are viewing this thread

Top Bottom