Display control for few seconds

J

Jane

Hello

Is it possible to display a control on a form for just a 5 seconds after
clicking a button

I have looked on google and all I can find is how to open a form then close
it after a few seconds but I would just like to show a text box on the same
form

Thank you for any help you can give with this problem

Jane Hollin
 
B

BruceM

Set the control's Visible property to No. In the command button's Click
event:

Me.ControName.Visible = True
Me.TimerInterval = 5000

In the form's Timer event:

Me.ControlName.Visible = False
Me.TimerInterval = 0

Another option may be to use the API here:
http://www.mvps.org/access/api/api0021.htm

I have not tried the code, so I cannot offer details about how it works, but
it looks fairly simple.
 
W

Wayne-I-M

Simple code that means you wont need to mess about with your form's timer

Private Sub ButtonName_Click()
Dim ShowTime As Date
ShowTime = Now()
Me.TexBoxName.Visible = True
Do Until ShowTime + 0.0000276 < Now()
DoEvents
If ShowTime + 0.0000276 < Now() Then Me.TextBoxName.Visible = False
Loop
End Sub


Note (VERY approx)
0.0000138= about 1second
0.0000276 = about 2 seconds
0.0000414 = about 3 seconds

I hope someone else will jump in and give you a more accurate set of numbers
as my excel skill are - to say the least - a but rusty ;-)

hope this helps
 
W

Wayne-I-M

Hi Ken

Not sure about this but I always though that tick counts were best done on
(at least) something of server power (hgh res)

Still think my method is simpler (once you can get the the exact decimal).
I tested it a few times and it works fine - I have used this is an app I am
working on at the moment

;-)
 
D

Dad

Jane said:
Hello

Is it possible to display a control on a form for just a 5 seconds after
clicking a button

I have looked on google and all I can find is how to open a form then
close
it after a few seconds but I would just like to show a text box on the
same
form

Thank you for any help you can give with this problem

Jane Hollin
 
D

Dad

Jane said:
Hello

Is it possible to display a control on a form for just a 5 seconds after
clicking a button

I have looked on google and all I can find is how to open a form then
close
it after a few seconds but I would just like to show a text box on the
same
form

Thank you for any help you can give with this problem

Jane Hollin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top