background color record continious form

H

Harry

Hi All.

Within my contious form I would like to change the background color of the
active record.
Browsing through this discussion forum I becam a little bit closer to the
solution, but somehow I cant get it to work!

The data for the form is coming from a query, so I do not have a primary key.
within the header I have placed an unbound textbox (enabled no - locked yes,
background transparant).
The value for this textbox
Private Sub Form_Current()
Me.txtCurrentKey = Me.CurrentRecord
end sub
At the textfield conditional format I have Expression is [CurrentRecord
]=[txtCurrentKey]

But it doesn't change color.

What am I doing wrong????

Greetings
Harry
 
O

OldPro

Hi All.

Within my contious form I would like to change the background color of the
active record.
Browsing through this discussion forum I becam a little bit closer to the
solution, but somehow I cant get it to work!

The data for the form is coming from a query, so I do not have a primary key.
within the header I have placed an unbound textbox (enabled no - locked yes,
background transparant).
The value for this textbox
Private Sub Form_Current()
Me.txtCurrentKey = Me.CurrentRecord
end sub
At the textfield conditional format I have Expression is [CurrentRecord
]=[txtCurrentKey]

But it doesn't change color.

What am I doing wrong????

Greetings
Harry

Where are you changing the color? The method I have used requires a
label under the entire row that is set to a particular font in order
to get the ascii character '219', which looks like a box. Only two
fonts that I know of have these extended ascii characters. A string
of these characters in a label creates a solid background for another
control which must be set to a transparent background. Are you sure
that you have followed all of the steps? Here is an example:
http://www.lebans.com/conditionalformatting.htm
 
M

Marshall Barton

Harry said:
Within my contious form I would like to change the background color of the
active record.
Browsing through this discussion forum I becam a little bit closer to the
solution, but somehow I cant get it to work!

The data for the form is coming from a query, so I do not have a primary key.
within the header I have placed an unbound textbox (enabled no - locked yes,
background transparant).
The value for this textbox
Private Sub Form_Current()
Me.txtCurrentKey = Me.CurrentRecord
end sub
At the textfield conditional format I have Expression is [CurrentRecord
]=[txtCurrentKey]

But it doesn't change color.

What am I doing wrong????


First, CurrentRecord is a property of the form object, so it
is just an undefined name when used without qualifying it
with the object you are interested in. You could have used:
Form.CurrentRecord =[txtCurrentKey]
BUT, that's useless for this purpose because the current
record does not change while CF is formatting the rows.

Bottom line - each record must have a field with a unique
value to get your desired effect.
 
H

Harry

Hi Marshall,

So far I can follow your explanation.
I've added a field (programid) on the form and unique for every row.
(the form is used to display all installed software on the selected computer).

Could you point me further to the solution?

Greetings,
Harry


Marshall Barton said:
Harry said:
Within my contious form I would like to change the background color of the
active record.
Browsing through this discussion forum I becam a little bit closer to the
solution, but somehow I cant get it to work!

The data for the form is coming from a query, so I do not have a primary key.
within the header I have placed an unbound textbox (enabled no - locked yes,
background transparant).
The value for this textbox
Private Sub Form_Current()
Me.txtCurrentKey = Me.CurrentRecord
end sub
At the textfield conditional format I have Expression is [CurrentRecord
]=[txtCurrentKey]

But it doesn't change color.

What am I doing wrong????


First, CurrentRecord is a property of the form object, so it
is just an undefined name when used without qualifying it
with the object you are interested in. You could have used:
Form.CurrentRecord =[txtCurrentKey]
BUT, that's useless for this purpose because the current
record does not change while CF is formatting the rows.

Bottom line - each record must have a field with a unique
value to get your desired effect.
 
M

Marshall Barton

I thought you already were doing everything else.

A typical approach is to size and position a text box so it
covers the entire detail section. Set its BackColor
property to the same value as the form's. Then use the
Conditional Formatting arrangement we've been discussing.

Once that is squared away, use Send To Back (Format menu) to
put it behind all the other controls.

You may also want to set the other control's BackStyle
property to Transparent.

If you have some other effect in mind, please explain it.
--
Marsh
MVP [MS Access]

So far I can follow your explanation.
I've added a field (programid) on the form and unique for every row.
(the form is used to display all installed software on the selected computer).

Could you point me further to the solution?

Marshall Barton said:
Harry said:
Within my contious form I would like to change the background color of the
active record.
Browsing through this discussion forum I becam a little bit closer to the
solution, but somehow I cant get it to work!

The data for the form is coming from a query, so I do not have a primary key.
within the header I have placed an unbound textbox (enabled no - locked yes,
background transparant).
The value for this textbox
Private Sub Form_Current()
Me.txtCurrentKey = Me.CurrentRecord
end sub
At the textfield conditional format I have Expression is [CurrentRecord
]=[txtCurrentKey]

But it doesn't change color.

What am I doing wrong????


First, CurrentRecord is a property of the form object, so it
is just an undefined name when used without qualifying it
with the object you are interested in. You could have used:
Form.CurrentRecord =[txtCurrentKey]
BUT, that's useless for this purpose because the current
record does not change while CF is formatting the rows.

Bottom line - each record must have a field with a unique
value to get your desired effect.
 

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