Timer Event

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I want to flash a label on and off if the feild "Hold1" = "h". I tried to use
the below code, but the label doesn't flash. Can anyone see my error and
offer a suggestion? Thanks

Private Sub Form_Timer()

If Me.HOLD1 = "h" Then
If lngTimeVar < 1000 Then
Me.lblOnHold.Visible = Not Me.lblOnHold.Visible
lngTimeVar = lngTimeVar + 250
Else
Me.lblOnHold.Visible = True
End If
End If
End Sub
 
P

PJFry

Try this:

Set your form timer to 500 or 1000, make lblOnHold not visible and use this
code:

If Me.HOLD1 = "h" Then
If Me.lblOnHold.Visible = True Then
Me.lblOnHold.Visible = False
ElseIf Me.lblOnHold.Visible = False Then
Me.lblOnHold.Visible = True
End If
End If

PJ

p.s. Make sure you don't use to many functions like this. You probably
won't run into a system resource issue, but you might.
 
M

mattc66 via AccessMonster.com

I had this on the Form_Timer event. From the below were are you suggesting I
place the code? Also the label doesn't have a timer.
Try this:

Set your form timer to 500 or 1000, make lblOnHold not visible and use this
code:

If Me.HOLD1 = "h" Then
If Me.lblOnHold.Visible = True Then
Me.lblOnHold.Visible = False
ElseIf Me.lblOnHold.Visible = False Then
Me.lblOnHold.Visible = True
End If
End If

PJ

p.s. Make sure you don't use to many functions like this. You probably
won't run into a system resource issue, but you might.
I want to flash a label on and off if the feild "Hold1" = "h". I tried to use
the below code, but the label doesn't flash. Can anyone see my error and
[quoted text clipped - 11 lines]
End If
End Sub
 
M

mattc66 via AccessMonster.com

Okay I did what you said and it works.. Some day I will understand all this
stuff..
I had this on the Form_Timer event. From the below were are you suggesting I
place the code? Also the label doesn't have a timer.
Try this:
[quoted text clipped - 19 lines]
 
P

PJFry

This is the best way learn!

Once your question has been answered, you can select a 'Did this answer your
question?' button at the bottom of the form. It puts a littel green check
next to the post so we geeks know it is all taken care of.

mattc66 via AccessMonster.com said:
Okay I did what you said and it works.. Some day I will understand all this
stuff..
I had this on the Form_Timer event. From the below were are you suggesting I
place the code? Also the label doesn't have a timer.
Try this:
[quoted text clipped - 19 lines]
End If
End Sub
 
M

mattc66 via AccessMonster.com

I am using accessmonster.com and I don't see that button. Sorry..
This is the best way learn!

Once your question has been answered, you can select a 'Did this answer your
question?' button at the bottom of the form. It puts a littel green check
next to the post so we geeks know it is all taken care of.
Okay I did what you said and it works.. Some day I will understand all this
stuff..
[quoted text clipped - 7 lines]
 

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