Avoid Flicker

JohnPapa

Registered User.
Local time
Today, 12:55
Joined
Aug 15, 2010
Messages
1,117
I am trying to avoid flicker on the form when I run the following code where all checkboxes are set to No.
I used Appilication.Echo set to False at the beginning and set to True end. Did not help
I used Me.Visible set to False at the beginning and set to True end. There is no flicker, during the update but a major flicker at the end.


Code:
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.MoveFirst
Do While Not rst.EOF
    If Nz(rst!blnNo, False) = False And Nz(rst!blnYes, False) = False Then
        rst.Edit
        rst!blnNo = True
        rst!blnYes = False
        rst.Update
    End If
    rst.MoveNext
Loop
Me.Dirty = False
 
Have you considered using an UPDATE query to change the source table and just requery the form?
 
Actually, I just tried that and was going to report on it. Thanks for the suggestion anyway.
There is still a flicker.

Code:
Application.Echo False
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE tblMedicalHistoryPatTempNew SET blnNo = True, blnYes = False WHERE lngMedicalHistory = " &      Forms!frmMedicalHistoryListNew!lngID & ";"
DoCmd.SetWarnings True
Me.Refresh     'Or Me.Requery
Me.cmdCancel.SetFocus
Application.Echo True
 
have you tried using Datasheet form?
 
does your form use conditional formatting? - that can sometimes impact form flicker
 
This seems to be a design flaw. Why are you resetting values on a bunch of child records at once?
 
you create a New Datasheet form from your table.
you don't use an "existing" continuous form and Switch to datasheet view.
continuous forms are notorious for flicker, because it need to "repaint" the controls everytime.
 
you create a New Datasheet form from your table.
you don't use an "existing" continuous form and Switch to datasheet view.
continuous forms are notorious for flicker, because it need to "repaint" the controls everytime.
Thanks for the suggestion. It may not be worth the effort to remove the flicker.
 
you can also add Conditional format to datasheet.
 
Yes it does. The yellow which indicates the current record uses conditional formatting.
try temporarily disabling the conditional formatting - does this stop the flickering?
 
you don't really need conditional format (for current record) in datasheet since, there is already a band to do this.
but to demonstrate i put the dsSub (datasheet) in a Form (2_Form1) to show that it can be done.
notice the flicker on 1_Continuous form, while almost none to 2_Form1.
 

Attachments

Users who are viewing this thread

Back
Top Bottom