• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 731
  • Last Modified:

Screen flickers on mouse move

Hi, my screen flickers on mouse-move over a button on a tab control

I looked at a couple of EE posts, and I applied the code from http://allenbrowne.com/ser-46.html.

It worked fine, converted several labels, but still it flickered.

Then I reviewed the form carefully (it's fairly simple) and found some unconverted labels. Ah ha ! I said, this should fix it. But no, it didn't. Then I found another unconverted label hiding on the bottom. Surely this will fix it, but no, it didn't. I ran allenbrowne's code a second time, nothing to convert.

Any thoughts?

0
Alaska Cowboy
Asked:
Alaska Cowboy
  • 10
  • 9
  • 5
  • +1
3 Solutions
 
puppydogbuddyCommented:
Hi Bill,
I don't know if this will work for a mouse move, but it has worked for me in the past when I experienced flicker while a requery was being executed in code behind a tab control. Here is what worked for me.  Turn screen painting off at the beginning of the proc in the tab control that would cause the screen to repaint (e.g. .requery or .visible type actions), then turn it back on..

Me.Painting = False
............................

........proc code......

Me.Painting = True



 
0
 
jjafferrCommented:
Hi williampeck,

Is there an "On Mouseover" [Event procedure] for the tab?

jaffer
0
 
Leigh PurvisDatabase DeveloperCommented:
As excellent as Allen Browne's stuff is - I've never used his routine to fix this.
I do it myself - so I *know* it's done.

I'm sure Allen has this covered - but if you run code like the following... does it bring back nothing?
(Looking for labels without a parent at all - on the page and off).

On Error Resume Next

    Dim ctl As Control
    Dim strName As String
    Dim strList As String
    Dim intType As Integer
   
    For Each ctl In Me.Controls
        If ctl.ControlType = acLabel Then
            strName = ctl.Parent.Name
            intType = ctl.Parent.ControlType
            If intType = acPage Or err Then
                strList = strList & "; " & ctl.Name & " on " & strName
                err.Clear
            End If
        End If
    Next
   
    If Len(strList) > 0 Then
        MsgBox Trim(Mid(strList, 2))
    End If


I *think* I've known images to flicker too.  But I know I've had applications with *bad* label flicker - but once I caught them all it was fine.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Alaska CowboyAuthor Commented:
LPurvis,

I put your code in a button's logic "Fix Flicker"

On the first control of a form ,
  it found the strName ("ReportsW-ScreenFlicker"), then
  the intType = 0 and immediately I get an error --> "Application-defined or object-defined error".

Not sure how to proceed . . .

Here's my code:
Private Sub cmdFixFlicker_Click()
On Error GoTo Err_cmdFixFlicker_Click

    Dim ctl As Control
    Dim strName As String
    Dim strList As String
    Dim intType As Integer
   
    For Each ctl In Me.Controls
        If ctl.ControlType = acLabel Then
            strName = ctl.Parent.Name
            intType = ctl.Parent.ControlType
            If intType = acPage Or Err Then
                strList = strList & "; " & ctl.Name & " on " & strName
                Err.Clear
            End If
        End If
    Next
   
    If Len(strList) > 0 Then
        MsgBox Trim(Mid(strList, 2))
    End If

Exit_cmdFixFlicker_Click:
    Exit Sub

Err_cmdFixFlicker_Click:
    MsgBox Err.Description
    Resume Exit_cmdFixFlicker_Click
   
End Sub
0
 
Leigh PurvisDatabase DeveloperCommented:
Yeah - the
On Error Resume Next
is vital.
Put that in instead of your error handling.
0
 
Alaska CowboyAuthor Commented:
LPurvis: Ok, now your code works fine, and it found an errant label, so I fixed it, but still the stupid thing flickers.

When I run your code now, nothing happens, so I assume all labels are ok. Nuts.

Thanks for the help. The tab control looks so nice and provides room to grow, now I'm stuck with a bland form with no tab control and everything crammed onto one page.
0
 
puppydogbuddyCommented:
Bill,
Did you try my suggestion in the on change event of the tab control or whatever event is occcuring when you are experiencing flicker?
0
 
Alaska CowboyAuthor Commented:
PDB, I did try it but I wasn't quite sure what I was doing.

Here's what I did

Private Sub cmdIssuesReport_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.Painting = False
    ReportId = 10
    GetReportInfo
    Me.Box11.SpecialEffect = 1
    Me.Box18.SpecialEffect = 3
    Me.Painting = True
End Sub

Is that what you meant? It's active code now but still flickers . . .
0
 
Leigh PurvisDatabase DeveloperCommented:
Any listboxes? :-S

*Something* must still be there - if you have no code of your own running.
(e.g. repaint on mouse move or timer etc).
0
 
puppydogbuddyCommented:
Bill,
Are you getting the flicker on just the mouse move, or on the change event of the tab control?
If it is just on the mouse move code above, I suspect it is because you are calling GetReportInfo,  which is returning the info too slow for the mouse move. I would put the screen painting commands in GetReportInfo where the actual code is executing, not here. So remove from here and put in GetReportInfo, then let me know what happened and we will go from there.
0
 
Leigh PurvisDatabase DeveloperCommented:
You're actually running that code in the Mouse move event - as a general part of the application - not just for testing?
0
 
Alaska CowboyAuthor Commented:
LPurvis, no listboxes. I have one re-paint true/false that I posted from PDB's suggestion.

PDB, it is flickering on the mousemove on a button, hold on, I'll put it in GetReportInfo.
0
 
Leigh PurvisDatabase DeveloperCommented:
Sorry - somehow I hadn't picked up on that that's what you're doing.

Mousemove events will *often* cause flickering.
I'd say even doing nothing else other then switch Painting off and back on again would likely generate *some* flickering.
(It isn't always helpful).

You might be able to get it down to a minimum...
Who knows.
0
 
puppydogbuddyCommented:
Bill/Leigh,
Here is the link to a post where I resolved a similar problem with flickering when there was a program call to another sub during execution by suggesting painting off and on.

http://www.experts-exchange.com/Databases/MS_Access/Q_21762120.html

                            PDB
0
 
Leigh PurvisDatabase DeveloperCommented:
Hi PDB - but Painting is already turned off and on here.
And it's flickering none the less.

And I've known it not help at all on occasions - and indeed has helped *cause* the problem.
Access 2003 is heavily (more so than any before it) display intensive.
I wouldn't be surprised if some actual hardware adapters didn't get flickers where others did.

Essentially varying from machine to machine.
0
 
Alaska CowboyAuthor Commented:
No flicker ! No flicker ! No flicker ! Hoo-ray.

Well, it does flicker once but then it's flickered out . . . Hardly noticeable

PDB, sorry I worked it out before your post, but thanks, excellent reference.

So I did a little de-bugging, commented everything out, then put things back in one line at a time.

Here's what did the trick - I removed the special effects, here's the code:

Private Sub cmdIssuesReport_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ReportId = 10
    GetReportInfo
'    Me.Box11.SpecialEffect = 1          ' now commented out
'    Me.Box18.SpecialEffect = 3          '         "           "
End Sub

Here is my GetReportInfo:

Public Sub GetReportInfo()

    Dim dbs As Database
    Dim rsReportInfo As Recordset
    Set dbs = CurrentDb
    Dim sql As String
   
    sql = "select * from Reports where Id = " & ReportId
    Set rsReportInfo = dbs.OpenRecordset(sql)

    If Not rsReportInfo.EOF Then
        Me.txtReportTitle = rsReportInfo("ReportName")
        Me.txtReportDescription = rsReportInfo("ReportDescription")
        Me.txtReportUsage = rsReportInfo("ReportUsage")
    End If    
End Sub

Note: in the GetReportInfo, I switched it to do three DLookups, but user wise, it's no difference.

Thanks to all !
0
 
puppydogbuddyCommented:
Bill,
Glad you got it resolved!  Out of curiousity, it was the special effects that was causing the flicker??? what did the special effects do? Also, you mention DLookups being put in the GetReportsInfo sub...where are they?? Did you mean you took them out ??

                                    PDB
0
 
Leigh PurvisDatabase DeveloperCommented:
I'm a tad confused about what's exactly solved it too.
Not really clear as yet.

(The Dlookups too - as this was the first time we'd seen the Sub)
0
 
Alaska CowboyAuthor Commented:
PDB and LPurvis, it was the special effects that caused the flicker. If they are in - flicker. Take them out - one flicker and then silence.

The special effects just make the box "raised" so as to alert the user. There are three buttons, each inside a box with other info. When the user hovers the mouse, the associated box goes "raised" and the others go "flat".

Maybe it's the combination of two special effects happening, causes Access to flake out, I mean flicker. maybe tonight I'll try and see if one special effect causes the flicker.

So I guess I'll have to do without the bit of sophisticated user interface . . .

0
 
Alaska CowboyAuthor Commented:
I couldn't stand the suspense . . . one special effect --> flicker. No special effects --> No flicker. I think this is EE gold.
0
 
Leigh PurvisDatabase DeveloperCommented:
EE Gold?
Sounds like a chocolate or an instant coffee.
"Oh Monsieur, with this EE Gold you are really spoiling us"

I'm not surprised that it was _any_ of the things you had in the Mousemove event - I stand by what I originally said (once I'd realized what was going on lol)

And what about the Dlookups?
0
 
Alaska CowboyAuthor Commented:
LPurvis, ok, how about chocolate with gold foil?

I put in the DLookups before I realized the special effects were the problem. I thought maybe it didnt' like the d.b. work (
  Dim dbs As Database
    Dim rsReportInfo As Recordset
    Set dbs = CurrentDb
    Dim sql As String
   
    sql = "select * from Reports where Id = " & ReportId
    Set rsReportInfo = dbs.OpenRecordset(sql)

    If Not rsReportInfo.EOF Then
        Me.txtReportTitle = rsReportInfo("ReportName")
        Me.txtReportDescription = rsReportInfo("ReportDescription")
        Me.txtReportUsage = rsReportInfo("ReportUsage")
    End If    
)

so I tried DLookups. But it still flickered until I narrowed it down to the special effect.
0
 
Leigh PurvisDatabase DeveloperCommented:
I promise you - the three DLookups worked the application harder than your recordset opening. :-)
0
 
Alaska CowboyAuthor Commented:
Yes, I finally figured that out a few months ago and use the record set processing judiciously . . .
0
 
Alaska CowboyAuthor Commented:
thanks for the assistance !
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 10
  • 9
  • 5
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now