Condtional formatting, continuous forms, grids

D

DavidAtCaspian

Hi:
I need to display what looks like a two column table. The first field needs
to be locked, the second user changeable.
When a record is selected, or the first field clicked, I'd like to change
the background colour of the first field to red (255).
The data for the display will be a recordset (currently using DAO) from an
existing table using an SQL selection - which effectively binds it to the
underlying table.
I have the subform, the field locking/unlocking and data display working
fine, but can't get the background bit working.

Any suggestions please?
Can't use a list box, can't find a grid,
Haven't worked out how to capture the fact that a record is selected (or
current) in datasheet view, or how to change the background colour in
datasheet view.
In continuous forms, ALL the record backgrounds change, not just the one I
want.

Can I do this (with Access 2002), or is there a free active x grid that
anyone knows of that will allow what should be quite a simple task.


Thanks
 
M

Marshall Barton

DavidAtCaspian said:
I need to display what looks like a two column table. The first field needs
to be locked, the second user changeable.
When a record is selected, or the first field clicked, I'd like to change
the background colour of the first field to red (255).
The data for the display will be a recordset (currently using DAO) from an
existing table using an SQL selection - which effectively binds it to the
underlying table.
I have the subform, the field locking/unlocking and data display working
fine, but can't get the background bit working.

Any suggestions please?
Can't use a list box, can't find a grid,
Haven't worked out how to capture the fact that a record is selected (or
current) in datasheet view, or how to change the background colour in
datasheet view.
In continuous forms, ALL the record backgrounds change, not just the one I
want.

Can I do this (with Access 2002), or is there a free active x grid that
anyone knows of that will allow what should be quite a simple task.


The trick is to use an unbound, hidden text box (name it
txtLineID) in the form's header or footer section. The
form's Current event is then used to set the text box to the
PK field:

Me.txtLineID = Me.txtPKfield

With that in place, you can use Conditional Formatting (View
menu) to check if the txtPKfield text box equals txtLineID
by using the Expression Is option:
[txtPKfield] = [txtLineID]
 
D

DavidAtCaspian

Thanks Marsh:
That did the job nicely.


Marshall Barton said:
DavidAtCaspian said:
I need to display what looks like a two column table. The first field needs
to be locked, the second user changeable.
When a record is selected, or the first field clicked, I'd like to change
the background colour of the first field to red (255).
The data for the display will be a recordset (currently using DAO) from an
existing table using an SQL selection - which effectively binds it to the
underlying table.
I have the subform, the field locking/unlocking and data display working
fine, but can't get the background bit working.

Any suggestions please?
Can't use a list box, can't find a grid,
Haven't worked out how to capture the fact that a record is selected (or
current) in datasheet view, or how to change the background colour in
datasheet view.
In continuous forms, ALL the record backgrounds change, not just the one I
want.

Can I do this (with Access 2002), or is there a free active x grid that
anyone knows of that will allow what should be quite a simple task.


The trick is to use an unbound, hidden text box (name it
txtLineID) in the form's header or footer section. The
form's Current event is then used to set the text box to the
PK field:

Me.txtLineID = Me.txtPKfield

With that in place, you can use Conditional Formatting (View
menu) to check if the txtPKfield text box equals txtLineID
by using the Expression Is option:
[txtPKfield] = [txtLineID]
 

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