Textbox and contents will not display (1 Viewer)

DOC666

New member
Local time
Today, 05:25
Joined
Apr 27, 2014
Messages
5
Can anyone help please

Me.TxtNotAllowed.Visible = True
dtTimer1 = Now
dtTimer2 = Now + TimeValue("00:00:10")
Me.TxtNotAllowed.Value = "You do not have permission to use this database !"
Do Until dtTimer1 >= dtTimer2
dtTimer1 = Now()
Loop
Me.TxtNotAllowed.Value = ""
DoCmd.Quit

The above code will run definetely for the 10 seconds however the textbox and contents do not display HOWEVER if stepped through with breakpoints line by line and the form checked each time the textbox DOES display and its contents.
:banghead:
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 05:25
Joined
Aug 30, 2003
Messages
36,138
Try adding

DoEvents

right before the loop.
 

DOC666

New member
Local time
Today, 05:25
Joined
Apr 27, 2014
Messages
5
Thanks Paul

Worked a treat

:)
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 05:25
Joined
Aug 30, 2003
Messages
36,138
Happy to help and welcome to the site by the way!
 

Users who are viewing this thread

Top Bottom