D
Dennis
All,
I'm on Access via XP Office Pro w SP3 on XP PRO w SP3.
I want to change the control's border color as I enter control and reset it
when I leave a control. The purpose of this is to draw the user's eye to the
current data entry field.
I know I can change the color using the On Entry and on Exit Events but as I
am still experiementing with this I would like to take it one step further.
I want to place the following code in the Entry and Exit events:
private sub On_CtlName_Entry()
Call SetControlBorderColor
end sub
private sub CtlName_On_Exit()
Call SetControlBorderColor
end sub
Private Sub SetControlBorderColor
plngOrigBorderColor = me.form."CurrentControl".BoderColor
me.form."CurrentControl".BorderColor = plngBorderColorNew
end sub
Privat sub ResetControlBorderColor
me.form."CurrentControl".BorderColor = plngOrigBorderColor
end sub
The variables plng... would be Private variables declared at the top of the
module.
Since I am still experiement with this process, I migth want to change the
backgroup and font color. I might also expand this functionally to change
the contents of the control to red if there is an error. I'm not quire sure
where this experiementing is going to take me.
Is there someway I can:
1. Pass the name of the current control to the subroutine and have the
subroutine change some of the control's properties? (Some of these controls
might be on a subform.)
or
2. Can I have the subroutine determine the name of the current control and
use that name to change the control's properties? I know that
"Screen.ActiveControl.Name" will return the current control's name, but I
don't know how to use that information to do what I want.
Thank you for your assitance.
I'm on Access via XP Office Pro w SP3 on XP PRO w SP3.
I want to change the control's border color as I enter control and reset it
when I leave a control. The purpose of this is to draw the user's eye to the
current data entry field.
I know I can change the color using the On Entry and on Exit Events but as I
am still experiementing with this I would like to take it one step further.
I want to place the following code in the Entry and Exit events:
private sub On_CtlName_Entry()
Call SetControlBorderColor
end sub
private sub CtlName_On_Exit()
Call SetControlBorderColor
end sub
Private Sub SetControlBorderColor
plngOrigBorderColor = me.form."CurrentControl".BoderColor
me.form."CurrentControl".BorderColor = plngBorderColorNew
end sub
Privat sub ResetControlBorderColor
me.form."CurrentControl".BorderColor = plngOrigBorderColor
end sub
The variables plng... would be Private variables declared at the top of the
module.
Since I am still experiement with this process, I migth want to change the
backgroup and font color. I might also expand this functionally to change
the contents of the control to red if there is an error. I'm not quire sure
where this experiementing is going to take me.
Is there someway I can:
1. Pass the name of the current control to the subroutine and have the
subroutine change some of the control's properties? (Some of these controls
might be on a subform.)
or
2. Can I have the subroutine determine the name of the current control and
use that name to change the control's properties? I know that
"Screen.ActiveControl.Name" will return the current control's name, but I
don't know how to use that information to do what I want.
Thank you for your assitance.