Solved

Blinking controls in Access VBA

Posted on 2011-03-16
13
1,006 Views
Last Modified: 2012-05-11
Hi Exprets,

I have a kiosk type form in an Access 2007 application. There is a tab control on the form, and it has 5 tabs.

When the form is entered, the screen flickers many times before the charts and other controls are drawn on each tab.

How can I stop this annoying flicker before someone has a seizure?

Thanks for any help.

0
Comment
Question by:WestCoastHip
13 Comments
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
Access 2003 had problems with flicker with un-attached labels on tab controls.  I know you siad this is A2007, but it may be the same thing.  Bugs often popup again.

 See if you have any.  When you click on a control in design view, you should see both the control and the label selected.

  If not, click on the label, do a cut, then select the control and do a paste.

JimD.
0
 

Author Comment

by:WestCoastHip
Comment Utility
Thanks for the tip Jim.

I re-attached the labels to the controls, but it did not remedy the flicker.

Let me know if you have any other ideas.

Thanks,

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
What is the code on the Enter event of the Form or Tab Control?

See if you have any "Requery" code there.

Also keep in mind that the more complex your forms (Tab controls, Graphics, Overlapping controls, too many controls, recordsets, ActiveXControls, Animations, Sounds, Timer code ...etc), ...the more resources you app uses to "Display" all of this, hence the probability of more "Flicker"

You may be able to do something with the Application.Echo, but let's see if the issue can't be remedied more simply...

JeffCoachman
0
 

Author Comment

by:WestCoastHip
Comment Utility
Jeff,

In the form_load, I call docmd.maximize.

If I take that line out, there is not problem......other than the form is not maximized.

I have tried to stop the form App.paint, and turned the echo on and off, but that does not help with the issue.

Thanks
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
Then resize (redesign) the form so that it is nearly full screen.
..and set the BorderStyle to: Dialog
This way, simply opening the form produces a nearly full sized window, thus no need to Maximize, and thus no flicker...


OR, simply change the Access Option: "Document Window Option" to: Tabbed Documents.
This will display view all opened objects (Tables, Forms, Queries, and Reports) in a "Tabbed" fashion, again, eliminating the need for a maximize and the subsequent "Flickering"...

JeffCoachman
0
 

Author Comment

by:WestCoastHip
Comment Utility
Thanks Jeff.

The problem is that the form has to run maximized in a kiosk.

Tabbed docs are probably not the best for that.

Thanks for looking at it though.

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 21
Comment Utility
Curious:
Is the Access front end on the machine's local drive?

A possible solution would be to use a loader/splash formt hat opens the other form the form hidden. The splash screen would use a timer event to give the other form time to load all the object before making it visible.



0
 

Author Comment

by:WestCoastHip
Comment Utility
HiTech,

Yes the front end is on the same PC.

If I remove the docmd.maximize from the form_load, the flicker disappears.

However, I require the form to run maximized.

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
Try this to open the form:

Private Sub Command0_Click()
MsgBox "Form Hidden"
    DoCmd.OpenForm "frmEmployees", , , , , acHidden
End Sub
...to open the employees form hidden

(Leave your maximize code as-is)

Then do this on the activate event of the form you just opened Hidden
Private Sub Form_Activate()
    Me.Visible = True
End Sub
0
 

Author Comment

by:WestCoastHip
Comment Utility
Boaq,

Thanks for the info.

I implemented it, and it does not seem to remedy the flicker, however it does make the form invisible.

I think I am going to have to use a splash screen form on a timer.
Thanks
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
Comment Utility
<however it does make the form invisible.>
...but the code on the Activate event should make it visible...

Or try this to open the form:

Private Sub Command0_Click()
    Application.Echo False
    DoCmd.OpenForm "frmEmployees", , , , , acHidden
End Sub
...to open the employees form hidden

(Leave your maximize code as-is)

Then do this on the activate event of the form you just opened.
Private Sub Form_Activate()
    Application.Echo True
End Sub
0
 

Author Closing Comment

by:WestCoastHip
Comment Utility
Thanks Boaq!

That is the ticket.

Cheers
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
;-)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now