ON GotFocus

RustyRick

Registered User.
Local time
Today, 14:33
Joined
Jan 31, 2013
Messages
123
When I tab to this button I'd like the border to change color so the typist knows where her focus is for sure. I've tried numerous syntax to no avail.

Why doesn't this one work?

=[RecOK_Label].[BorderColor]="#22B14C"
 
To the Label so it creates quite a eye catching sign for the typist. Otherwise it's hard to see where the "Focus" is at.
 
Private Sub RecOK_GotFocus()
[RecOK_Label].[BorderColor] = "#22B14C"
End Sub

Didn't like that, turned yellow
 
The other thing you can try is the conditional format property to set the background colour - use the condition Field Has Focus.

It works for text boxes and combo boxes but not labels, buttons, lists or checkboxes. Not sure about other control types but basically it should be useable if you can click 'into' the control.

Main benefit is it if you have a form in datasheet or continuous from view
 
First, a control built with normal methods will have a label associated with it. If you have a "GotFocus" VBA routine on the control, you could write a function that scans the collection of all controls on the form, checking the .Parent of each control to see if it matches then control that just went into focus.

Code:
Dim ctlX as Access.Control
Dim booX as Boolean

...  {ctlY is the control in focus}

booX = False

For Each ctlX in Me.Controls
  If not (ctlX.Parent Is Null) then
    if ctlXParent = ctlY then
      booX = True
      Exit For
    end if
  end if

If booX then {ctlX is the label of ctlY, do your thing to both...}

(Or something like that, I'm shooting from the hip)
 
I should be more specific. The 2nd last button on my routine in filling a form is to "tab" to a "yes/no" button concurring if the record is correct or not. If it is a "no", the record may be wrong, but the information entered is what was reported to me on "hard copy", so I must enter it the way it's reported. Go back to the record bearer and get him to correct. It also helps confirm my typing. So it's confirming the correctness of the record so I can query the table for erroneous data.

However when I tab to that control the screen indication is so minuscule that your not sure if it's in focus. Secondly I want to ensure that the typist confirms that control are either "Yes/No", because the next tab in "New Record".

So to my way of thinking to change a thick border from Green to Red would definitely be "eye catching". thanks
 
"I'm a certified grandpa and proud of it.
Not quite so valuable"

heck no, your way more valuable now, got some precious lives to build into. I know :-)
 

Users who are viewing this thread

Back
Top Bottom