?
Solved

Make button Blink/Flash issue

Posted on 2008-10-18
6
Medium Priority
?
872 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 2000 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22749437
you are welcome!!!
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

752 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