Solved

Blinking controls in Access VBA

Posted on 2011-03-16
13
1,015 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
ID: 35146568
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
ID: 35146715
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
ID: 35148765
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
ID: 35150614
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
ID: 35150818
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
ID: 35151260
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 21
ID: 35151506
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
ID: 35160647
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
ID: 35162238
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
ID: 35168252
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
ID: 35172718
<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
ID: 35172994
Thanks Boaq!

That is the ticket.

Cheers
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35175491
;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

867 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

22 Experts available now in Live!

Get 1:1 Help Now