have bmp img file on form appear to be flashing

hello,
have attached sample db.
open database and form opens.
if you enter 123 for serial number and hit enter- a lemon bmp image file becomes visible-
(logic is if there is more than 2 records with same serial number the image is visible)
question:
Is there a way with timer interval (or something else) to make image look like it is flashing (when it is visible)?
thank you-
Data1.accdb
davetoughAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mbizupCommented:
I can't download your database, but this is the basic idea:

In the same code where you make the image visible, add the following line:

Me.TimerInterval = 1000  'This will execute your timer event every second

Open in new window


Then in the timer event:


'This toggles the visibility of the image (flashes it)
Me.imgMyImage.Visible = Not Me.imgMyImage.Visible

Open in new window



And if you want to turn off the timer/flashing:

Me.TimerInterval = 0 'This will turn off your timer and stop the flashing

Open in new window

0
davetoughAuthor Commented:
Thanks- i wonder if my example is corrupted-
i placed code:

Private Sub serial_AfterUpdate()
Me.txtCount = DCount("*", "tblServer", "serial='" & Me.serial & "'")
If Me.txtCount > 2 Then
Me.TimerInterval = 1000
Me.imgLemon.Visible = True

Else
Me.imgLemon.Visible = False
End If

End Sub

in textbox- logic- when more than 2 same serial numbers - image displays-
can i use image like this?

am having hard time finding timerinterval- thought it was just in properties of image?
or maybe am not doing something right here
thank you
0
mbizupCommented:
<<thought it was just in properties of image? >>

No... Timer Interval and the Timer Event are associated with the form itself.  So try this:


Private Sub serial_AfterUpdate()
   Me.txtCount = DCount("*", "tblServer", "serial='" & Me.serial & "'")
   If Me.txtCount > 2 Then
      Me.TimerInterval = 1000
      Me.imgLemon.Visible = True

    Else
       Me.imgLemon.Visible = False
       Me.TimerInterval = 0   '<---- This turns off the flashing
   End If

Open in new window


You  might also need the above code in the current event of your form.


And use the timer event of the form as I described earlier:

Private Sub Form_Timer()


'This toggles the visibility of the image (flashes it)
Me.imgLemon.Visible = Not Me.imgLemon.Visible

End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
davetoughAuthor Commented:
thank you for explanation and code-
0
Jeffrey CoachmanMIS LiasonCommented:
<No Points wanted>
Just note that the timer is low on the processors priority list.
So the flashing may not be as "Consistent" as you might want...

For example this might be an ideal  1 second Flash:
On..........Off..........On..........Off..........ON..........Off

But in reality the flashing might end up being like this:
On..........Off................On..Off.......ON..Off.............
(Not here that the "Total Time" is the same, but the flashing is irregular)

...So the flashing may be off depending on what else the computer has running.

It also can cause odd things to happen if you open the VB editor while it is running.

JeffCoachman
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.