Yes, you can use the Form's timer event to change the back color of a field back and forth. ljprodev@yahoo.com
Professional Development
MS Access Applications
In the OnTimer Event of your form place this code:
If ControlName.BackColor = 16777215 Then
ControlName.BackColor = 255
Else
ControlName.BackColor = 16777215
End If
Then in timer interval place something like 500 for an interval (adjust to your desire). This will make a control that blinks back and forth between Red and White.
Joe Miller
joe.miller@flotech.net
The above code works great! I appreciate it but it causes a little problem..is there a way to stop the timer when a button is pressed...i have a button thats runs a macro that will print a label for the current record on the form..in the macro i set it to print that "id" so just that form prints...with the timer event running it screws it up....
To fix this I would hide a control that has a value that changes when the button is pressed. Then the on timer event can look at that control first to see if it needs to fire off the blink code. So for demonstration let's put in a checkbox control called BlinkControl and we'll use 0 for "No Blink" and -1 for "Blink." Make the controls default value -1 for "Blink." Now our code in the ontimer event changes to this:
If BlinkControl = -1 then
If ControlName.BackColor = 16777215 Then
ControlName.BackColor = 255
Else
ControlName.BackColor = 16777215
End If
End If
Now when your print button is pressed we need to put a line of code at the top that stops the blinking. It goes like this:
BlinkControl = 0
The last step is to modify the OnCurrent event of the form and put in the following line to reset the blinking to "ON" when the user moves between records. That code is:
BlinkControl = -1
Once it's working correctly, set the BlinkControl's Visible property to No and the user won't see it making it nice and clean.
What it does'nt like is the time interval...if i set it to anything other then 0 it wont work....is there a way to set the time interval back to 0 when the print button is pressed...I tryed a couple of things but could not make it work...
What is the program doing when you press the print button? Is it erroring? What's the error? Is it not printing the button? Is it going to code in the window and saying that it's invalid? I need a little more to go on.. Joe Miller
joe.miller@flotech.net
Dim Message, Title, Default
Message = "Enter The Number of Sample Labels To Print For This Line Item "
Title = "Azusa Facility Systems Dept."
MyValue = InputBox(Message, Title)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.