.visible = true not working

T

tw

I have code in a timer event that is very simple. It is just supposed to
show a label on a form. The label's property sheet has visible = false
TimerInterval property is set to 1000 on form_load() event.

The following code works when I step through it, but when I just run the
form it doesn't work.

Private Sub Form_timer()
On Error Resume Next
Dim strMsg As String
Dim strPath As String
Dim strUpdateTool As String
Const q As String * 1 = """"

'if versions match, then proceed with opening of main form.
If strVerClient = strVerServer Then
Me.lblLoadingMenu.Visible = True
DoCmd.OpenForm "frmSwitchboardLoader"
else
.....<snip>

This form is a splash screen that shows the current version number. It also
checks the version number on the server to make sure they are in sync. If
not it will run code to update the version running. I have taken this code
from an article I found by Danny Lesandrini. I'm making some modifications
to the code, and this is one of them.

My form frmSwitchboardLoader basically creates the Switchboard Items table
on the fly based on user permissions. The label I want to show is a simple
message to let the user know the menu options are being loaded.

When I put in a breakpoint and step through the code
me.lblLoadingMenu.Visible = true actually causes the label to be visible.
When I run the code without a break I never see the label. In either case
the form frmSwitchboardLoader work fine. The form frmSplash (this form)
stays on the screen long enough that I should see the message. What am I
doing wrong? Even if I put a timer pause between the label visible and the
form load I still don't see the label when running the code without a
breakpoint.
 
B

Brendan Reynolds

Try ...

Me.Repaint

.... after the line that changes the .Visible property, and before the line
that opens the other form. If that doesn't work on its own, try adding ...

DoEvents

.... after the Me.Repaint line.
 
T

tw

me.repaint worked w/o DoEvents
Thanks

Brendan Reynolds said:
Try ...

Me.Repaint

... after the line that changes the .Visible property, and before the line
that opens the other form. If that doesn't work on its own, try adding ...

DoEvents

... after the Me.Repaint line.
 
Top