troubleshooting Question

microsoft access vba code help with timer events

Avatar of sxxgupta
sxxguptaFlag for United States of America asked on
Microsoft Access
2 Comments1 Solution502 ViewsLast Modified:
I would like an experts help in vba to make a text box on a form change the textbox's background color from white to blue (any shade) every 2 seconds on the OnCurrent event property of the form.  This color blinking shall only occur when the text box is visible and isnull in value as I scroll through the records in my form. The name of the text box is Text100.   Right now, when the form opens, it automatically opens to a new record.

I have the code pasted below and it works for the most part.  The only problem is that as I start scrolling through past records, whatever color was "captured" the moment I clicked the record navigation button (i.e., moving back from the new record), that color then holds onto the text box for all past records.  Can an expert please help.
Private Sub Form_Current()

If Me.Text102.Visible = True And IsNull(Me.Text102) Then
Me.TimerInterval = 1000
End If

end sub

Private Sub Form_Timer()
If Me.Text102.Visible = True And IsNull(Me.Text102) Then
    With Me.Text102
        .BackColor = (IIf(.BackColor = vbWhite, vbRed, vbWhite))
    End With
End If
End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros