Solved

Make button Blink/Flash issue

Posted on 2008-10-18
6
824 Views
Last Modified: 2012-05-05
Experts,

I have the following code below and it works good but it seems to cause some kind of issue in the code window (when hit alt F-11).  What happens is difficult to explain but it is affecting my typing in the window.  I need the code to only execute if the frmFacilityDetails is open.  I think that might correct the typing issue I have in the code of other forms.  Maybe this issue is known by another expert.  

Private Sub Form_Timer()

    'FLASH OF NOTES TEXT BOX.
'IT WORKS ANDISTHEONLY PLACEI NEED IT...NOCURRENT EVENT.
Static blnRed As Boolean
If Nz(DCount("FacilityDetailsID", "tblNotesPerFacility", "FacilityDetailsID= " & Nz(Me!FacilityDetailsID.Value, 0)), 0) > 0 Then
    If blnRed = True Then
        Me.txtNotes2.ForeColor = 255
        Me.txtNotes2.FontBold = True
        blnRed = False
    Else
        Me.txtNotes2.ForeColor = vbBlack
        Me.txtNotes2.FontBold = False
        blnRed = True
    End If
Else
End If

End Sub
0
Comment
Question by:Petrobras
  • 4
  • 2
6 Comments
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 22748897
try breaking your codes in the current event and timer event

private sub form_current()

If Nz(DCount("FacilityDetailsID", "tblNotesPerFacility", "FacilityDetailsID= " & Nz(Me!FacilityDetailsID.Value, 0)), 0) > 0 Then

me.timerinterval=300
end if

end sub

private sub form_timer()
with me.txtNotes2
       .forecolor=iif(.forecolor=vbred,vbblack,vbred)
       .fontbold=iif(.fontbold=true,false,true)
end with
end sub
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 22748950


private sub form_timer()
Static blnRed As Boolean
with me.txtNotes2
    If blnRed = True Then
        .ForeColor = 255
        .FontBold = True
        blnRed = False
    Else
        .ForeColor = vbBlack
        .FontBold = False
        blnRed = True
    End If
end with
end sub
0
 

Author Comment

by:Petrobras
ID: 22749121
Capricorn, I made the changes (Using the second on timer event posted).  The problem now is that the button blinks all the time when going from record to record instead of blinking when there is a record in tblNotesPerFacility based on the current [FacilityDetailsID].  

What do you think now?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 22749339


private sub form_current()

If Nz(DCount("FacilityDetailsID", "tblNotesPerFacility", "FacilityDetailsID= " & Nz(Me!FacilityDetailsID.Value, 0)), 0) > 0 Then

me.timerinterval=300

else

me.timerinterval=0
end if
0
 

Author Comment

by:Petrobras
ID: 22749394
worked perfectly.  Thank you sir...
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 22749437
you are welcome!!!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now