Changing forecolor

P

Peter Kinsman

I would like to change the forecolor of a datasheet control if it has been
changed from its original value - which is on an invisible control. Reading
back through recent posts, am I correct in thinking that this can only be
done by changing the datasheet to continuous forms but displaying them as a
datasheet?
I have used this technique to display a datasheet with two combo boxes,
where the query for the second is filtered by the selection in the first.
That works, but I am having a problem with the headings, which revert to the
control name, even though I have added a caption to the field in the
underlying query. Whether or not column headings are displayed makes no
difference.
Any ideas please?

Many thanks

Peter Kinsman
 
M

Marshall Barton

Peter said:
I would like to change the forecolor of a datasheet control if it has been
changed from its original value - which is on an invisible control. Reading
back through recent posts, am I correct in thinking that this can only be
done by changing the datasheet to continuous forms but displaying them as a
datasheet?
I have used this technique to display a datasheet with two combo boxes,
where the query for the second is filtered by the selection in the first.
That works, but I am having a problem with the headings, which revert to the
control name, even though I have added a caption to the field in the
underlying query. Whether or not column headings are displayed makes no
difference.


The column heading in datasheet view is the label attached
to the text box. You can change that by setting the label
control's Caption property.

You can use Conditional Formatting (View menu) to specify
the ForeColor for some records. Set the Expressions Is
option to something like:
[thistextbox] <> [hiddentextbox]

Note that when you specify the form's Default View as
DataSheet, you are not using continuous form and vice versa.
So, you are not correct about whatever confusion brought on
that contradictory thought.
 
P

Peter Kinsman

Marsh
Thanks for the reply
The subform's default view is Continuous Forms, but I execute
DoCmd.RunCommand acCmdSubformDatasheet
when the subform gets the focus, so that it can behave like continuous forms
but display as a datasheet. I have just looked up "Link Label to a Control"
in the help and this describes how to get the headings right, so now I will
try the conditional formatting.

Regards

Peter

Marshall Barton said:
Peter said:
I would like to change the forecolor of a datasheet control if it has been
changed from its original value - which is on an invisible control.
Reading
back through recent posts, am I correct in thinking that this can only be
done by changing the datasheet to continuous forms but displaying them as
a
datasheet?
I have used this technique to display a datasheet with two combo boxes,
where the query for the second is filtered by the selection in the first.
That works, but I am having a problem with the headings, which revert to
the
control name, even though I have added a caption to the field in the
underlying query. Whether or not column headings are displayed makes no
difference.


The column heading in datasheet view is the label attached
to the text box. You can change that by setting the label
control's Caption property.

You can use Conditional Formatting (View menu) to specify
the ForeColor for some records. Set the Expressions Is
option to something like:
[thistextbox] <> [hiddentextbox]

Note that when you specify the form's Default View as
DataSheet, you are not using continuous form and vice versa.
So, you are not correct about whatever confusion brought on
that contradictory thought.
 
M

Marshall Barton

I don't see any need to have the form's DefaultView set to
continuous anf then have to change it. Just set the
DefaultView to Datasheet and be done with it.

Let us know how it goes with CF.
--
Marsh
MVP [MS Access]


Peter said:
The subform's default view is Continuous Forms, but I execute
DoCmd.RunCommand acCmdSubformDatasheet
when the subform gets the focus, so that it can behave like continuous forms
but display as a datasheet. I have just looked up "Link Label to a Control"
in the help and this describes how to get the headings right, so now I will
try the conditional formatting.


"Marshall Barton" wrote
Peter said:
I would like to change the forecolor of a datasheet control if it has been
changed from its original value - which is on an invisible control.
Reading
back through recent posts, am I correct in thinking that this can only be
done by changing the datasheet to continuous forms but displaying them as
a
datasheet?
I have used this technique to display a datasheet with two combo boxes,
where the query for the second is filtered by the selection in the first.
That works, but I am having a problem with the headings, which revert to
the
control name, even though I have added a caption to the field in the
underlying query. Whether or not column headings are displayed makes no
difference.


The column heading in datasheet view is the label attached
to the text box. You can change that by setting the label
control's Caption property.

You can use Conditional Formatting (View menu) to specify
the ForeColor for some records. Set the Expressions Is
option to something like:
[thistextbox] <> [hiddentextbox]

Note that when you specify the form's Default View as
DataSheet, you are not using continuous form and vice versa.
So, you are not correct about whatever confusion brought on
that contradictory thought.
 
P

Peter Kinsman

Marsh

Conditional Formatting is much easier than I had expected.
The complicated subform is used to build up Products, which can contain
Recipes, Ingredients, Packaging and Labour. Having selected the type in the
first (Type) combo box, the contents of the second (Description) combo box
is filtered. If I use a normal datasheet, then when I select the Type of a
new constituent, all descriptions of existing constituents which are not of
the same Type disappear. Marius showed me how to get round the problem, but
by a process of trial and error, I
have found that attaching a label to a control sets the heading when the
datasheet is finally displayed.
So no problems for the present.

Cheers

Peter

Marshall Barton said:
I don't see any need to have the form's DefaultView set to
continuous anf then have to change it. Just set the
DefaultView to Datasheet and be done with it.

Let us know how it goes with CF.
--
Marsh
MVP [MS Access]


Peter said:
The subform's default view is Continuous Forms, but I execute
DoCmd.RunCommand acCmdSubformDatasheet
when the subform gets the focus, so that it can behave like continuous
forms
but display as a datasheet. I have just looked up "Link Label to a
Control"
in the help and this describes how to get the headings right, so now I
will
try the conditional formatting.


"Marshall Barton" wrote
Peter Kinsman wrote:
I would like to change the forecolor of a datasheet control if it has
been
changed from its original value - which is on an invisible control.
Reading
back through recent posts, am I correct in thinking that this can only
be
done by changing the datasheet to continuous forms but displaying them
as
a
datasheet?
I have used this technique to display a datasheet with two combo boxes,
where the query for the second is filtered by the selection in the
first.
That works, but I am having a problem with the headings, which revert to
the
control name, even though I have added a caption to the field in the
underlying query. Whether or not column headings are displayed makes no
difference.


The column heading in datasheet view is the label attached
to the text box. You can change that by setting the label
control's Caption property.

You can use Conditional Formatting (View menu) to specify
the ForeColor for some records. Set the Expressions Is
option to something like:
[thistextbox] <> [hiddentextbox]

Note that when you specify the form's Default View as
DataSheet, you are not using continuous form and vice versa.
So, you are not correct about whatever confusion brought on
that contradictory thought.
 

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