Solved How do I alter the same property on multiple text boxes and combo boxes? (1 Viewer)

vargan

New member
Local time
Today, 05:10
Joined
Mar 5, 2015
Messages
7
Hi, all!

I want to highlight the active control, as the cursor is difficult to see from time to time. I saw, at another forum, that you could write a sub, place it in a module and refer to it in the form properties window, selecting multiple fields at the same time.

When trying to, i get an error stating (translated from norwegian,some words maynot be the ones used in the english statement)
"The expression selected as the event property caused the error "Object does not contain the automation object setYellow"

Code is
sub setYellow
if me.activecontrol.controltype= actextbox or me activecontrol.controltype=accombobox then
me.activecontrol.forecolor=vbyellow
end if
end sub

This is placed in a module

It is referred to in the form properties pane, onenter event, as =[setYellow]
But does not work....

Any ideas?

Best regards

vargan
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:10
Joined
May 7, 2009
Messages
19,175
just add Conditional Format to your Textbox/combobox.
in design view of your form, select all textbox/combobox (leave out other controls).
on ribbon->format->conditional format, create new rule.
cf1.png
 

vargan

New member
Local time
Today, 05:10
Joined
Mar 5, 2015
Messages
7
I feel stupid.....

THANK YOU!

/vargan
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:10
Joined
May 7, 2009
Messages
19,175
I feel stupid.....
it happens all the time to me.
when we thinking too far yet we forget the basics.

edit:

in chess they called it blunder.
 

Users who are viewing this thread

Top Bottom