By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,049 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

How do I make a "conditional Format" on a record in a subform

P: n/a
Dear NG,

I would like to format a record in a subform, dependent on a value in one
field.
If one field in the record I show in a subform (datasheet view) is true I
like to view that particular row in green, all other rows just as they are
normal. Is that possible ?

regards
Allan

Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Allan Koch" <al***@koch.dk> wrote in message
news:40***********************@dread16.news.tele.d k...
Dear NG,

I would like to format a record in a subform, dependent on a value in one
field.
If one field in the record I show in a subform (datasheet view) is true I
like to view that particular row in green, all other rows just as they are
normal. Is that possible ?

regards
Allan


Of course a record doesn't have any colour - it is the controls (the
textboxes, etc) on the form which can have a colour. With Access 2k onwards
you can simply use conditional formatting.

Open the subform in design view and highlight the textboxes you wish to
change colour. From the Format menu select Conditional Formatting and enter
an expression such as "MyField=10" and select the colour.
Fletcher
Nov 12 '05 #2

P: n/a
Hi Fletcher,

Thanks !
Yes I know a record doesn't have a colour.
I used your advise, the only thing is that I am not able to have the hole
line formatted in one solid colour because check box fields do not have the
"conditional format" available. Do you think there is a cure for that ? ( I
want it to look like, you have selected the hole record row, just in a
different colour than black)
regards
allan
"Fletcher Arnold" <fl****@home.com> wrote in message
news:bv**********@hercules.btinternet.com...
"Allan Koch" <al***@koch.dk> wrote in message
news:40***********************@dread16.news.tele.d k...
Dear NG,

I would like to format a record in a subform, dependent on a value in one field.
If one field in the record I show in a subform (datasheet view) is true I like to view that particular row in green, all other rows just as they are normal. Is that possible ?

regards
Allan
Of course a record doesn't have any colour - it is the controls (the
textboxes, etc) on the form which can have a colour. With Access 2k

onwards you can simply use conditional formatting.

Open the subform in design view and highlight the textboxes you wish to
change colour. From the Format menu select Conditional Formatting and enter an expression such as "MyField=10" and select the colour.
Fletcher

Nov 12 '05 #3

P: n/a
"Allan Koch" <al***@koch.dk> wrote in message
news:40***********************@dread16.news.tele.d k...
Hi Fletcher,

Thanks !
Yes I know a record doesn't have a colour.
I used your advise, the only thing is that I am not able to have the hole
line formatted in one solid colour because check box fields do not have the "conditional format" available. Do you think there is a cure for that ? ( I want it to look like, you have selected the hole record row, just in a
different colour than black)
regards
allan

Hi Allan
If you have your subform in datasheet view, then you probably have the least
flexibility in what it looks like. If you used the continuous forms view
then other possibilities are opened up such as placing shapes or many
transparent textboxes placed on one coloured one. However, on balance, I
still prefer the datasheet view for subforms and I would probably not use a
check box.
I would define a field in my query such as:
IIf([MyField]=1,"X",Null) AS TrueOrFalse
So that I could use a textbox to display an "X" rather than use a checkbox.
Of course, you then have to write code to allow updating. Perhaps someone
else might have an imaginative suggestion and Stephen Lebans is a likely
candidate - you could try his website at
http://www.lebans.com/

Fletcher
Nov 12 '05 #4

P: n/a
Hi Fletcher,
Very useful information.
An other question, a little related.
My subform contain a lot of fields, and I really would like to keep the
first column locked, meaning it will stay in pos. 1 when I scroll sideways
with the other fields. Is that possible ?
Regards
Allan
"Fletcher Arnold" <fl****@home.com> wrote in message
news:bv**********@sparta.btinternet.com...
"Allan Koch" <al***@koch.dk> wrote in message
news:40***********************@dread16.news.tele.d k...
Hi Fletcher,

Thanks !
Yes I know a record doesn't have a colour.
I used your advise, the only thing is that I am not able to have the hole line formatted in one solid colour because check box fields do not have the
"conditional format" available. Do you think there is a cure for that ?

( I
want it to look like, you have selected the hole record row, just in a
different colour than black)
regards
allan

Hi Allan
If you have your subform in datasheet view, then you probably have the

least flexibility in what it looks like. If you used the continuous forms view
then other possibilities are opened up such as placing shapes or many
transparent textboxes placed on one coloured one. However, on balance, I
still prefer the datasheet view for subforms and I would probably not use a check box.
I would define a field in my query such as:
IIf([MyField]=1,"X",Null) AS TrueOrFalse
So that I could use a textbox to display an "X" rather than use a checkbox. Of course, you then have to write code to allow updating. Perhaps someone
else might have an imaginative suggestion and Stephen Lebans is a likely
candidate - you could try his website at
http://www.lebans.com/

Fletcher

Nov 12 '05 #5

P: n/a
"Allan Koch" <al***@koch.dk> wrote in message
news:40***********************@dread16.news.tele.d k...
Hi Fletcher,
Very useful information.
An other question, a little related.
My subform contain a lot of fields, and I really would like to keep the
first column locked, meaning it will stay in pos. 1 when I scroll sideways
with the other fields. Is that possible ?
Regards
Allan

Sure - this is very easy. Highlight the column in datasheet view and from
the Format menu select Freeze Columns.
Fletcher
Nov 12 '05 #6

P: n/a
Great, Thanks again.
I was looking in Format at the Top menubar :-(
Regards
Allan
"Fletcher Arnold" <fl****@home.com> wrote in message
news:bv**********@hercules.btinternet.com...
"Allan Koch" <al***@koch.dk> wrote in message
news:40***********************@dread16.news.tele.d k...
Hi Fletcher,
Very useful information.
An other question, a little related.
My subform contain a lot of fields, and I really would like to keep the
first column locked, meaning it will stay in pos. 1 when I scroll sideways with the other fields. Is that possible ?
Regards
Allan

Sure - this is very easy. Highlight the column in datasheet view and from
the Format menu select Freeze Columns.
Fletcher

Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.