Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

Highlighting Active Field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jbhansen - 31 Mar 2005 17:43 GMT
I read through a previous post on this same subject, but this is a different
"twist":

I would like to highlight the active control as I tab through my forms, but
I don't like using the transparent property to do it because I don't want the
inactive fields to blend into the background.

I've tried setting the backcolor by using Screen.ActiveControl.BackColor in
a public function with the gotfocus and lostfocus events, but I need help.

This method works once I've got a form open, BUT I'm running into problems
when I open a form and the focus goes to the first control.  I get the error
"Run-time error '2474': The expression you entered requires the control to be
in the active window."

Here's the code I'm using:

Public Function LeaveControl() 'turn control shading white
   Screen.ActiveControl.BackColor = 16777215
End Function
Public Function EnterControl() 'turn control shading yellow
   Screen.ActiveControl.BackColor = 13828095
End Function

And then I'll call the appropriate function from each control's gotfocus or
lostfocus event to highlight and turn back to white.

Please give me some direction!  Thanks in advance.
jbhansen - 31 Mar 2005 22:03 GMT
I just answered my own question:

I didn't realize that Conditional Formatting had a "Field Has Focus"
function that seems to be able to do just what I wanted.

> I read through a previous post on this same subject, but this is a different
> "twist":
[quoted text clipped - 24 lines]
>
> Please give me some direction!  Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.