Display a button on a form after 10 seconds (1 Viewer)

Lateral

Registered User.
Local time
Today, 07:45
Joined
Aug 28, 2013
Messages
388
Hi guys


I have tried to figure this out myself without success.


I have a form that is popped up when the user clicks a button on the main form.


This popup provides information that the User must read.


There is a "CLICK TO CONTINUE" button on the popup to enable them to continue to the next step of the process.


The problem is that the user is not reading the form and just clicking the "CLICK TO CONTINUE" button.


I would like the popup to be displayed but the "CLICK TO CONTINUE" button to be invisible for 10 seconds to force the User to read it.


Can somebody please help me?


Thanks
Cheers
 

Lateral

Registered User.
Local time
Today, 07:45
Joined
Aug 28, 2013
Messages
388
I just figured it out!


I needed to add some code to the On Load event that initially set the Visible property of the button to False and then set the On Timer to set the Visible property to True after a few seconds....
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:45
Joined
Sep 21, 2011
Messages
14,372
Perhaps you should change it to 'Click to Confirm' that they have read the popup.?
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:45
Joined
Sep 21, 2011
Messages
14,372
For my benefit, would you care to post the code please.?

TIA
 

Lateral

Registered User.
Local time
Today, 07:45
Joined
Aug 28, 2013
Messages
388
Hi Gasman


Here is the code...it's pretty simple:



Private Sub Form_Load()
Command1.Visible = False
End Sub

Private Sub Form_Timer()
Command1.Visible = True
End Sub


You then need to set the Timer Interval to some value



Cheers
Greg
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:45
Joined
Sep 21, 2011
Messages
14,372
You then need to set the Timer Interval to some value
Cheers
Greg

Yes, 0 I believe?, though in your case obviously that does not matter.

I've not had to use the Timer event yet, so thank you.
 

isladogs

MVP / VIP
Local time
Today, 15:45
Joined
Jan 14, 2017
Messages
18,251
Yes, 0 I believe?, though in your case obviously that does not matter.

No. The timer event is in milliseconds so for a 10 second delay, set the value to 10000
Setting it to 0 disables the timer event.

@Lateral
You know the phrase "You can take a horse to water but you can't make them drink"
Just because the button is delayed for 10 seconds, it still doesn't mean anyone will read your message!

Personally I would start with the button visible but disabled & then enable it after the delay

One other thing you could try is used by Microsoft & others to encourage you to read the EULA.
Deliberately make the message too long to make in the textbox so users have to scroll to the end.
Only then make the button enabled/visible.

If you do that, the timer event is redundant again.
 

Micron

AWF VIP
Local time
Today, 10:45
Joined
Oct 20, 2018
Messages
3,478
Agree with Isladogs. People will probably reorganize on their desk, grab the newspaper, open a snack... anything but read your prompt as they've seen it 100 times before.
FWIW, a pause procedure in a standard module is the way I'd go because you can call it from anywhere in the db, plus you don't have to convert seconds. E.g.
Code:
Public Function Pause(intSecs As Integer)
Dim Start As Variant
Start = Timer
Do While Timer < Start + intSecs
    DoEvents
Loop
End Function
For 10 seconds, you call it like

Pause (10)

Maybe there is an issue that you'd like comments on how to handle as opposed to how to do what you're doing?
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:45
Joined
Sep 21, 2011
Messages
14,372
No. The timer event is in milliseconds so for a 10 second delay, set the value to 10000
Setting it to 0 disables the timer event.

Colin,
That is what I was aiming for. Button is hidden for 10 seconds then the timer is switched off as no longer needed after button is made visible.? I see no point of making a visible button visible every 10 seconds?
 

isladogs

MVP / VIP
Local time
Today, 15:45
Joined
Jan 14, 2017
Messages
18,251
Ah I see. Just switch it off after the timer runs once
Modify the code in post 6 to

Code:
Private Sub Form_Timer()
   Command1.Visible = True
   Me.TimerInterval=0
End Sub

or use Micron's code
 

Users who are viewing this thread

Top Bottom