colors

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to have a piece of data that is displayed in a form flash to gain attention. The form's Timer event is already used up by a requery so I went into the code of the forms Open event to set up a for-next routine that would change the text boxes forecolor with the code below....but it won't work 8-( It just changes to the second color and I never see the red.

ptname.SetFocu
ptname.ForeColor = 25
Dim x As Doubl
For x = 1 To 9900
Next
ptname.ForeColor = 44528

I know this is simple and I'm just missing something...but can't think what it is...

thanks for lookin
 
Well, I'm not sure what you are trying to do, but 99000 is not nearly long
enough to see the intial red. Try 9999000. You ought to see the red for
about half a second.

Another thing to try is this:
'put this in the declarations of any Standard Module (not form module)
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds as Long)

'use it in your code like this:
ptname.SetFocus
ptname.ForeColor = 255
Sleep 1000
ptname.ForeColor = 445285

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

Chris McK said:
I'm trying to have a piece of data that is displayed in a form flash to
gain attention. The form's Timer event is already used up by a requery so I
went into the code of the forms Open event to set up a for-next routine that
would change the text boxes forecolor with the code below....but it won't
work 8-( It just changes to the second color and I never see the red.
 
Hi Chris

The Form_Open procedure runs before the form is first displayed. You can
see this if you put a MsgBox at the end of Form_Open. So your ForeColor is
being set to red, your loop is running, it's set to the second colour, and
*then* you get to see it.

Really, the Form_Timer event is the only way to achieve this. If you need
to use it for two different things, you can write code in the event
procedure to figure out, based on elapsed time, which timer event needs to
be serviced.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Chris McK said:
I'm trying to have a piece of data that is displayed in a form flash to
gain attention. The form's Timer event is already used up by a requery so I
went into the code of the forms Open event to set up a for-next routine that
would change the text boxes forecolor with the code below....but it won't
work 8-( It just changes to the second color and I never see the red.
 
Back
Top