Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / July 2007

Tip: Looking for answers? Try searching our database.

Blinking

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
an - 24 Jul 2007 17:56 GMT
Hi!

I OnTimer have a Me!lblBlink.Visible = Not Me!lblBlink.Visible
Work fine.
Question:
1 - I would like that it blinking only after click on command button;
2 - That it blinking only "n" times.

Is it possible, please?

Thanks in advance.
an
Douglas J. Steele - 24 Jul 2007 18:17 GMT
Set the form's TimerInterval property in the Click event of that command
button.

Add a declaration for a Static variable in the Timer event to keep track of
how many times the code's been executed, and set the TimerInterval to 0 once
you've hit the desired limit.

Private Sub Form_Timer()

Static intIterations As Integer

 Me!lblBlink.Visible = Not Me!lblBlink.Visible
 intIterations = intIterations + 1

 If intIterations >= 5 Then
   Me.TimerInterval = 0
   intIterations = 0
 End If

End Sub

(Of course, I'd caution against putting flashing on your form. It can
actually cause medical problems for certain users!)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hi!
>
[quoted text clipped - 8 lines]
> Thanks in advance.
> an
an - 24 Jul 2007 18:36 GMT
Exactly, DS.

Work fine.
Thank you very much.
an

> Set the form's TimerInterval property in the Click event of that command
> button.
[quoted text clipped - 32 lines]
> > Thanks in advance.
> > an
Arvin Meyer [MVP] - 24 Jul 2007 19:00 GMT
> (Of course, I'd caution against putting flashing on your form. It can
> actually cause medical problems for certain users!)

Certain rates (I've heard 3 to 4 per second) can cause epilepsy to trigger
in those afflicted with the disease.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

an - 24 Jul 2007 19:14 GMT
Ok, AM
Thank you.
an

> > (Of course, I'd caution against putting flashing on your form. It can
> > actually cause medical problems for certain users!)
>
> Certain rates (I've heard 3 to 4 per second) can cause epilepsy to trigger
> in those afflicted with the disease.
Arvin Meyer [MVP] - 24 Jul 2007 18:21 GMT
You won't need the Timer. In the command button code (air code):

Sub MyButton_Click()
Dim i As Integer
For i = 1 To 10 ' 5 on, 5 off
   Wait (0.5) ' 1/2 second
   Me!lblBlink.Visible = Not Me!lblBlink.Visible
Next i
End Sub

Public Function Wait(sngSecs As Single)
' Timer is a keyword that retrieves the number of seconds
' since midnight as a single
Dim sngWait As Single

sngWait = Timer + sngSecs
While Timer < sngWait
   DoEvents
Wend

End Function
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Hi!
>
[quoted text clipped - 8 lines]
> Thanks in advance.
> an
an - 24 Jul 2007 18:50 GMT
Many thanks, AM.

Work fine too.
an

> You won't need the Timer. In the command button code (air code):
>
[quoted text clipped - 29 lines]
> > Thanks in advance.
> > an
an - 24 Jul 2007 19:16 GMT
Please:

For default the label IsVisible.
Is possible to change it for NotVisible for default?
Thanks.
an

> You won't need the Timer. In the command button code (air code):
>
[quoted text clipped - 29 lines]
> > Thanks in advance.
> > an
Arvin Meyer [MVP] - 24 Jul 2007 20:07 GMT
Sure, set the label's visible property to false, then add this line
immediately after the Dim statement:

Me!lblBlink.Visible = True

If you want to turn it back off, set it to false:

Me!lblBlink.Visible = False

just before the End Sub line.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Please:
>
[quoted text clipped - 36 lines]
>> > Thanks in advance.
>> > an
an - 24 Jul 2007 20:44 GMT
Perfect, AM.

Many, many thanks.
an

> Sure, set the label's visible property to false, then add this line
> immediately after the Dim statement:
[quoted text clipped - 46 lines]
> >> > Thanks in advance.
> >> > an
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.