highlight cell that cursor is in

J

JMspecial

I am trying to figure out how to highlight a row all the way across (several
columns) a table to show where the curor is. So if the cursor is on row 22
and in the 4th column, I want the entire row to be highlighted. If this is
not possible then how can I highlight just the text field that the curor is
in?

Thanks
 
T

tina

if you're using Excel (rows and columns), suggest you post your question to
an Excel newsgroup. if you're using Access (records and fields), then you
can't do it in Datasheet view of a *table*. instead, use a form to view your
data and, in A2000 or newer version, set Conditional Formatting (under
Format on the menu bar in form design view) on each bound control in the
form to change the BackColor property using the FieldHasFocus option.

hth
 
C

chris.nebinger

Well, you can do it via code, but there the method is very clunky.

The code would look like:

Dim ctl As Control
Set ctl = Screen.ActiveControl
ctl.Parent.Controls(0).SetFocus
ctl.Parent.SelWidth = ctl.Parent.Count

Now, the question remains on how do you start this code. The only way
I can think of is to use a hidden form with a timer to check every so
often. Alternatively, datasheet views would work as well.

On a datasheet view, simply add this to the OnCurrent event, and you
will have exactly what you are looking for.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top