chnging back/foregrnd props in continuous frm view for 'active' re

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

my a2k form is actually a 'child' sub-form (but that probably doesn't
matter). what i want is to enable the form to change color when it is showing
the 'active' record.

when i checked on it, the background color of the details section of the
sub-form was 14613758 which is the same as the rest of the form and main
form. let's say we want to change it to 4227327 when it's the active record.
the name of the actual sub-form is "Adverse Events (child)".

sound doable? using vba?
 
i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.
 
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.
 
hey marsh!

at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.

does that make sense?

best,

-ted

Marshall Barton said:
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.
--
Marsh
MVP [MS Access]

i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.
 
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield ] = [txtCurrentKey]
 
hi marsh,

gotcha :-)

if i can, can we try to expand on this for the "general case" where the
table's pk field is actually comprised not of one but a couple.

i think we went through this once before when i was interested in having
this capability applied to current/active records viewed via the 'datasheet'
modality, so i have a hunch i think i know what the approach'd be. but i like
to err 'on the side of the angels'.

best,

-ted


Marshall Barton said:
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield ] = [txtCurrentKey]
--
Marsh
MVP [MS Access]

at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.
 
Err on the side of angels?? What's wrong with a little
experimentation on a copy of your database?

Whatever! For each PK field, add a hidden text box to the
form's header along with the corresponding line line of code
in the Current event.

Then the Conditional Formatting expression would be:

[pk1] = [txtKey1] And [pk2] = [txtKey2] And . . .
--
Marsh
MVP [MS Access]

if i can, can we try to expand on this for the "general case" where the
table's pk field is actually comprised not of one but a couple.

i think we went through this once before when i was interested in having
this capability applied to current/active records viewed via the 'datasheet'
modality, so i have a hunch i think i know what the approach'd be. but i like
to err 'on the side of the angels'.


Marshall Barton said:
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield] = [txtCurrentKey]

at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.


:
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.


Ted wrote:
i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.


:
my a2k form is actually a 'child' sub-form (but that probably doesn't
matter). what i want is to enable the form to change color when it is showing
the 'active' record.

when i checked on it, the background color of the details section of the
sub-form was 14613758 which is the same as the rest of the form and main
form. let's say we want to change it to 4227327 when it's the active record.
the name of the actual sub-form is "Adverse Events (child)".
 
i'm confused by a couple of points you raised and would like some
clarification...

a) how do you use the "Send to back" format option. i don't see it on the
litany of format options available in the l/u you get when you click 'Format'
in the textbox's properties

use
b) i think you mistyped what you were intending to say in the fragment below

Make at least your label controls have
can you recall what you started out to tell me.

c) lastly (this is the dumbest question of all of 'em) when i create the
requisite number of txtCurKey text boxes in the header

the Conditional Formatting expression would be:
[pk1] = [txtKey1] And [pk2] = [txtKey2] And . .

am i supposed to put [pk1] = [txtKey1] into the CF for the first one, and
then put [pk2] = [txtKey2 into the CF of the second one and so forth, or is
[pk1] = [txtKey1] And [pk2] = [txtKey2] And .... supposed to be some sort of
monster expresion that gets put into each of their CF?

best,

-ted


Marshall Barton said:
Err on the side of angels?? What's wrong with a little
experimentation on a copy of your database?

Whatever! For each PK field, add a hidden text box to the
form's header along with the corresponding line line of code
in the Current event.

Then the Conditional Formatting expression would be:

[pk1] = [txtKey1] And [pk2] = [txtKey2] And . . .
--
Marsh
MVP [MS Access]

if i can, can we try to expand on this for the "general case" where the
table's pk field is actually comprised not of one but a couple.

i think we went through this once before when i was interested in having
this capability applied to current/active records viewed via the 'datasheet'
modality, so i have a hunch i think i know what the approach'd be. but i like
to err 'on the side of the angels'.


Marshall Barton said:
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield] = [txtCurrentKey]


Ted wrote:
at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.


:
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.


Ted wrote:
i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.


:
my a2k form is actually a 'child' sub-form (but that probably doesn't
matter). what i want is to enable the form to change color when it is showing
the 'active' record.

when i checked on it, the background color of the details section of the
sub-form was 14613758 which is the same as the rest of the form and main
form. let's say we want to change it to 4227327 when it's the active record.
the name of the actual sub-form is "Adverse Events (child)".
 
i did some 9th inning experimenting and want 2 erase my previous questions
and comments. this is currently working as we wanted it to. couldn't be
happier :-)

thanks a bunch.

best,

-ted


Marshall Barton said:
Err on the side of angels?? What's wrong with a little
experimentation on a copy of your database?

Whatever! For each PK field, add a hidden text box to the
form's header along with the corresponding line line of code
in the Current event.

Then the Conditional Formatting expression would be:

[pk1] = [txtKey1] And [pk2] = [txtKey2] And . . .
--
Marsh
MVP [MS Access]

if i can, can we try to expand on this for the "general case" where the
table's pk field is actually comprised not of one but a couple.

i think we went through this once before when i was interested in having
this capability applied to current/active records viewed via the 'datasheet'
modality, so i have a hunch i think i know what the approach'd be. but i like
to err 'on the side of the angels'.


Marshall Barton said:
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield] = [txtCurrentKey]


Ted wrote:
at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.


:
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.


Ted wrote:
i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.


:
my a2k form is actually a 'child' sub-form (but that probably doesn't
matter). what i want is to enable the form to change color when it is showing
the 'active' record.

when i checked on it, the background color of the details section of the
sub-form was 14613758 which is the same as the rest of the form and main
form. let's say we want to change it to 4227327 when it's the active record.
the name of the actual sub-form is "Adverse Events (child)".
 
marsh,

in doing some further testing i found myself absentmindedly clicking in the
'body' of the continuous form's 'current' record display (as opposed to the
left vertical bar) in an effort....to my chagrin i found that while the color
changed as i'd expected, there was nothing visible --- it was as if the
transparent 'dummy' control had gone opaque on me and wasn't allowing the
data to shine through. the problem disappears or never arrives when you click
on the left vertical bar where the pointer's displayed but i thought i'd
outsmart this devilish detail by setting some properties, like locked to
'yes' and enabled to 'no' and tabstop to 'no' but all to no apparent avail
:-) is this the achilees' heel in all this? can this be circumvented? i'd
like to 'failsafe' the app'n so users don't need to worry about where their
cursor's sitting so long as it's more or less 'on' the current record.

best,

-ted


Marshall Barton said:
Err on the side of angels?? What's wrong with a little
experimentation on a copy of your database?

Whatever! For each PK field, add a hidden text box to the
form's header along with the corresponding line line of code
in the Current event.

Then the Conditional Formatting expression would be:

[pk1] = [txtKey1] And [pk2] = [txtKey2] And . . .
--
Marsh
MVP [MS Access]

if i can, can we try to expand on this for the "general case" where the
table's pk field is actually comprised not of one but a couple.

i think we went through this once before when i was interested in having
this capability applied to current/active records viewed via the 'datasheet'
modality, so i have a hunch i think i know what the approach'd be. but i like
to err 'on the side of the angels'.


Marshall Barton said:
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield] = [txtCurrentKey]


Ted wrote:
at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.


:
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.


Ted wrote:
i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.


:
my a2k form is actually a 'child' sub-form (but that probably doesn't
matter). what i want is to enable the form to change color when it is showing
the 'active' record.

when i checked on it, the background color of the details section of the
sub-form was 14613758 which is the same as the rest of the form and main
form. let's say we want to change it to 4227327 when it's the active record.
the name of the actual sub-form is "Adverse Events (child)".
 
You are correct that the text box needs to be locked and
disabled so that it can not receive the focus no matter
what.

The thing we forgot is that the Enabled property is one of
the ones that is set by Conditional Formatting, so just
change the CF setting for Enabled to make the CF example
look grayed out (the text box's Locked property set to Yes
will make it look normal on the form).
--
Marsh
MVP [MS Access]

in doing some further testing i found myself absentmindedly clicking in the
'body' of the continuous form's 'current' record display (as opposed to the
left vertical bar) in an effort....to my chagrin i found that while the color
changed as i'd expected, there was nothing visible --- it was as if the
transparent 'dummy' control had gone opaque on me and wasn't allowing the
data to shine through. the problem disappears or never arrives when you click
on the left vertical bar where the pointer's displayed but i thought i'd
outsmart this devilish detail by setting some properties, like locked to
'yes' and enabled to 'no' and tabstop to 'no' but all to no apparent avail
:-) is this the achilees' heel in all this? can this be circumvented? i'd
like to 'failsafe' the app'n so users don't need to worry about where their
cursor's sitting so long as it's more or less 'on' the current record.


Marshall Barton said:
Err on the side of angels?? What's wrong with a little
experimentation on a copy of your database?

Whatever! For each PK field, add a hidden text box to the
form's header along with the corresponding line line of code
in the Current event.

Then the Conditional Formatting expression would be:

[pk1] = [txtKey1] And [pk2] = [txtKey2] And . . .

if i can, can we try to expand on this for the "general case" where the
table's pk field is actually comprised not of one but a couple.

i think we went through this once before when i was interested in having
this capability applied to current/active records viewed via the 'datasheet'
modality, so i have a hunch i think i know what the approach'd be. but i like
to err 'on the side of the angels'.


:
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield] = [txtCurrentKey]


Ted wrote:
at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.


:
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.


Ted wrote:
i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.


:
my a2k form is actually a 'child' sub-form (but that probably doesn't
matter). what i want is to enable the form to change color when it is showing
the 'active' record.

when i checked on it, the background color of the details section of the
sub-form was 14613758 which is the same as the rest of the form and main
form. let's say we want to change it to 4227327 when it's the active record.
the name of the actual sub-form is "Adverse Events (child)".
 
i think i hear you saying enabled=no, locked=yes and tabstop=no, marsh. when
all that combo's all set up, houston, we have a problemo. when i use
enabled=no, locked=no and tabstop = no, it (the big back-ended box) then
looks greyed out but still no cigar. what am i doing wrong. just tell me what
settings are needed in clear simple terms for a simple mind.

Marshall Barton said:
You are correct that the text box needs to be locked and
disabled so that it can not receive the focus no matter
what.

The thing we forgot is that the Enabled property is one of
the ones that is set by Conditional Formatting, so just
change the CF setting for Enabled to make the CF example
look grayed out (the text box's Locked property set to Yes
will make it look normal on the form).
--
Marsh
MVP [MS Access]

in doing some further testing i found myself absentmindedly clicking in the
'body' of the continuous form's 'current' record display (as opposed to the
left vertical bar) in an effort....to my chagrin i found that while the color
changed as i'd expected, there was nothing visible --- it was as if the
transparent 'dummy' control had gone opaque on me and wasn't allowing the
data to shine through. the problem disappears or never arrives when you click
on the left vertical bar where the pointer's displayed but i thought i'd
outsmart this devilish detail by setting some properties, like locked to
'yes' and enabled to 'no' and tabstop to 'no' but all to no apparent avail
:-) is this the achilees' heel in all this? can this be circumvented? i'd
like to 'failsafe' the app'n so users don't need to worry about where their
cursor's sitting so long as it's more or less 'on' the current record.


Marshall Barton said:
Err on the side of angels?? What's wrong with a little
experimentation on a copy of your database?

Whatever! For each PK field, add a hidden text box to the
form's header along with the corresponding line line of code
in the Current event.

Then the Conditional Formatting expression would be:

[pk1] = [txtKey1] And [pk2] = [txtKey2] And . . .


Ted wrote:
if i can, can we try to expand on this for the "general case" where the
table's pk field is actually comprised not of one but a couple.

i think we went through this once before when i was interested in having
this capability applied to current/active records viewed via the 'datasheet'
modality, so i have a hunch i think i know what the approach'd be. but i like
to err 'on the side of the angels'.


:
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield] = [txtCurrentKey]


Ted wrote:
at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.


:
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.


Ted wrote:
i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.


:
my a2k form is actually a 'child' sub-form (but that probably doesn't
matter). what i want is to enable the form to change color when it is showing
the 'active' record.

when i checked on it, the background color of the details section of the
sub-form was 14613758 which is the same as the rest of the form and main
form. let's say we want to change it to 4227327 when it's the active record.
the name of the actual sub-form is "Adverse Events (child)".
 
Text box properties:
Locked Yes
Enabled No

Conditional Formatting properties:
BackColor whatever
Enabled No

The TabSptop doesn't matter, because a locked and disabled
control can not receive the focus.
--
Marsh
MVP [MS Access]

i think i hear you saying enabled=no, locked=yes and tabstop=no, marsh. when
all that combo's all set up, houston, we have a problemo. when i use
enabled=no, locked=no and tabstop = no, it (the big back-ended box) then
looks greyed out but still no cigar. what am i doing wrong. just tell me what
settings are needed in clear simple terms for a simple mind.


Marshall Barton said:
You are correct that the text box needs to be locked and
disabled so that it can not receive the focus no matter
what.

The thing we forgot is that the Enabled property is one of
the ones that is set by Conditional Formatting, so just
change the CF setting for Enabled to make the CF example
look grayed out (the text box's Locked property set to Yes
will make it look normal on the form).

in doing some further testing i found myself absentmindedly clicking in the
'body' of the continuous form's 'current' record display (as opposed to the
left vertical bar) in an effort....to my chagrin i found that while the color
changed as i'd expected, there was nothing visible --- it was as if the
transparent 'dummy' control had gone opaque on me and wasn't allowing the
data to shine through. the problem disappears or never arrives when you click
on the left vertical bar where the pointer's displayed but i thought i'd
outsmart this devilish detail by setting some properties, like locked to
'yes' and enabled to 'no' and tabstop to 'no' but all to no apparent avail
:-) is this the achilees' heel in all this? can this be circumvented? i'd
like to 'failsafe' the app'n so users don't need to worry about where their
cursor's sitting so long as it's more or less 'on' the current record.


:
Err on the side of angels?? What's wrong with a little
experimentation on a copy of your database?

Whatever! For each PK field, add a hidden text box to the
form's header along with the corresponding line line of code
in the Current event.

Then the Conditional Formatting expression would be:

[pk1] = [txtKey1] And [pk2] = [txtKey2] And . . .


Ted wrote:
if i can, can we try to expand on this for the "general case" where the
table's pk field is actually comprised not of one but a couple.

i think we went through this once before when i was interested in having
this capability applied to current/active records viewed via the 'datasheet'
modality, so i have a hunch i think i know what the approach'd be. but i like
to err 'on the side of the angels'.


:
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield] = [txtCurrentKey]


Ted wrote:
at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.


:
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.


Ted wrote:
i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.


:
my a2k form is actually a 'child' sub-form (but that probably doesn't
matter). what i want is to enable the form to change color when it is showing
the 'active' record.

when i checked on it, the background color of the details section of the
sub-form was 14613758 which is the same as the rest of the form and main
form. let's say we want to change it to 4227327 when it's the active record.
the name of the actual sub-form is "Adverse Events (child)".
 
hi marsh,

when i use locked=yes, enabled=no i don't see the greyed out appearance/look
on the big textbox; whatever, but what i guess is another hangup is this--i
haven't a clue as to how you're proposing we disable the textbox from w/in
the conditional formatting environment. unless my eyesight's going (always a
possibility), i don't see this capability in the cf formatting window thing.
my suspicion is that in addtion to this 'expression'

[Patient Number]=[txtCurKey1] And [MedNumber]=[txtCurKey2]

in the cf window, there be adjoined some vba/vbalike text which disables it.
yes?

best,

-ted


Marshall Barton said:
Text box properties:
Locked Yes
Enabled No

Conditional Formatting properties:
BackColor whatever
Enabled No

The TabSptop doesn't matter, because a locked and disabled
control can not receive the focus.
--
Marsh
MVP [MS Access]

i think i hear you saying enabled=no, locked=yes and tabstop=no, marsh. when
all that combo's all set up, houston, we have a problemo. when i use
enabled=no, locked=no and tabstop = no, it (the big back-ended box) then
looks greyed out but still no cigar. what am i doing wrong. just tell me what
settings are needed in clear simple terms for a simple mind.


Marshall Barton said:
You are correct that the text box needs to be locked and
disabled so that it can not receive the focus no matter
what.

The thing we forgot is that the Enabled property is one of
the ones that is set by Conditional Formatting, so just
change the CF setting for Enabled to make the CF example
look grayed out (the text box's Locked property set to Yes
will make it look normal on the form).


Ted wrote:
in doing some further testing i found myself absentmindedly clicking in the
'body' of the continuous form's 'current' record display (as opposed to the
left vertical bar) in an effort....to my chagrin i found that while the color
changed as i'd expected, there was nothing visible --- it was as if the
transparent 'dummy' control had gone opaque on me and wasn't allowing the
data to shine through. the problem disappears or never arrives when you click
on the left vertical bar where the pointer's displayed but i thought i'd
outsmart this devilish detail by setting some properties, like locked to
'yes' and enabled to 'no' and tabstop to 'no' but all to no apparent avail
:-) is this the achilees' heel in all this? can this be circumvented? i'd
like to 'failsafe' the app'n so users don't need to worry about where their
cursor's sitting so long as it's more or less 'on' the current record.


:
Err on the side of angels?? What's wrong with a little
experimentation on a copy of your database?

Whatever! For each PK field, add a hidden text box to the
form's header along with the corresponding line line of code
in the Current event.

Then the Conditional Formatting expression would be:

[pk1] = [txtKey1] And [pk2] = [txtKey2] And . . .


Ted wrote:
if i can, can we try to expand on this for the "general case" where the
table's pk field is actually comprised not of one but a couple.

i think we went through this once before when i was interested in having
this capability applied to current/active records viewed via the 'datasheet'
modality, so i have a hunch i think i know what the approach'd be. but i like
to err 'on the side of the angels'.


:
Ahhh, so it's the current record on a continuous form. In
that case, add a hidden text box named txtCurrentKey to the
form's header section and add a line of code to the form's
Current event:
Me.txtCurrentKey = Me!pkfield 'table's primary key field

Next, create a text box (without an attached label) and size
it to the fill the entire detail section. Set its BackColor
property to the standard color code (14613758). Then use
the Format - Send To Back menu item to place it behind all
the other controls. Make at least your label controls have
a transparent BackStyle. Now you can use Conditional
Formatting (Format menu) to set the BackColor of this big
text box:

Expression Is: [pkfield] = [txtCurrentKey]


Ted wrote:
at the risk of offending the lexicographers among us, to me the 'active
record' would be instance/view of the continous form's when the pointer sits
upon it; the information appearing via the continuous form's display on the
crt which can be immediately accessed by the user.


:
Sorry, Ted, but I have no idea what you mean by "when it's
the active record".

It's simple enough to change a section's BackColor property:
Me.Section(0).BackColor = 4227327
but there must be something more to your question than just
that.


Ted wrote:
i think i needed to fine tune my objective to read i wanted to change the
background color of the 'details' section alone, leaving the other sections
color be.


:
my a2k form is actually a 'child' sub-form (but that probably doesn't
matter). what i want is to enable the form to change color when it is showing
the 'active' record.

when i checked on it, the background color of the details section of the
sub-form was 14613758 which is the same as the rest of the form and main
form. let's say we want to change it to 4227327 when it's the active record.
the name of the actual sub-form is "Adverse Events (child)".
 
Ted said:
when i use locked=yes, enabled=no i don't see the greyed out appearance/look
on the big textbox; whatever, but what i guess is another hangup is this--i
haven't a clue as to how you're proposing we disable the textbox from w/in
the conditional formatting environment. unless my eyesight's going (always a
possibility), i don't see this capability in the cf formatting window thing.
my suspicion is that in addtion to this 'expression'

[Patient Number]=[txtCurKey1] And [MedNumber]=[txtCurKey2]

in the cf window, there be adjoined some vba/vbalike text which disables it.
yes?


No, your expression looks ok.

You won't see that appearance in the big text box on the
form. What I was referring to is the Conditional Formatting
window's Preview box.

The far right thingy in the Conditional Formatting window,
after Bold, Italic, Underline, BackColor, ForeColor, is
where you set the CF's Enabled property (it looks like a
little text box). Click the little thingy until the Preview
box is grayed out.
 
BINGO, marsh :-)

it's totally strange, i've looked at that panel dozens of times and never
noticed that sucker before. now that i have i can't help but wonder how/why
it works in this instance (as in what's it doing that we need it to do). not
totally important, my users won't care much less even know about it's service
-- just intellectually curious.

all the best,

-ted


Marshall Barton said:
Ted said:
when i use locked=yes, enabled=no i don't see the greyed out appearance/look
on the big textbox; whatever, but what i guess is another hangup is this--i
haven't a clue as to how you're proposing we disable the textbox from w/in
the conditional formatting environment. unless my eyesight's going (always a
possibility), i don't see this capability in the cf formatting window thing.
my suspicion is that in addtion to this 'expression'

[Patient Number]=[txtCurKey1] And [MedNumber]=[txtCurKey2]

in the cf window, there be adjoined some vba/vbalike text which disables it.
yes?


No, your expression looks ok.

You won't see that appearance in the big text box on the
form. What I was referring to is the Conditional Formatting
window's Preview box.

The far right thingy in the Conditional Formatting window,
after Bold, Italic, Underline, BackColor, ForeColor, is
where you set the CF's Enabled property (it looks like a
little text box). Click the little thingy until the Preview
box is grayed out.
 
As I tried to say before, if the CF Enabled property is set
to Yes then the big text box on the form will be enabled
when the color changes. This mean that the big text box
will only be locked and can receive the focus, even if you
can not do anything to it. As soon as the text box (or any
control) receives the focus, it is automatically brought to
the front where it will obscur the other controls that were
in fornt of it. By making sure it remains disabled, we are
preventing the big text box from receiving the focus, so it
will stay behind the other controls. Clear? ;-)
--
Marsh
MVP [MS Access]


BINGO, marsh :-)

it's totally strange, i've looked at that panel dozens of times and never
noticed that sucker before. now that i have i can't help but wonder how/why
it works in this instance (as in what's it doing that we need it to do). not
totally important, my users won't care much less even know about it's service
-- just intellectually curious.

Ted said:
when i use locked=yes, enabled=no i don't see the greyed out appearance/look
on the big textbox; whatever, but what i guess is another hangup is this--i
haven't a clue as to how you're proposing we disable the textbox from w/in
the conditional formatting environment. unless my eyesight's going (always a
possibility), i don't see this capability in the cf formatting window thing.
my suspicion is that in addtion to this 'expression'

[Patient Number]=[txtCurKey1] And [MedNumber]=[txtCurKey2]

in the cf window, there be adjoined some vba/vbalike text which disables it.
yes?
Marshall Barton said:
No, your expression looks ok.

You won't see that appearance in the big text box on the
form. What I was referring to is the Conditional Formatting
window's Preview box.

The far right thingy in the Conditional Formatting window,
after Bold, Italic, Underline, BackColor, ForeColor, is
where you set the CF's Enabled property (it looks like a
little text box). Click the little thingy until the Preview
box is grayed out.
 
this has been off the radar screen for around two months, marsh and the
trail's gotten lukewarm, so now i'm back on it and things aren't quite what
they were before. i'll try and explain.

i created the big text box which i sized to accord with the details
section's. its name is Text51 and has the background color of 14613758. i
have sent it to the back and made sure that the labels on the pre-existing
details section have a transparent background.

let's see what else.....

the sub-form's called 'Adverse Events (child)' and i placed three invisible
text controls in its header section, naming them 'txtCurKey1',
'txtCurKey2',.....,'txtCurKey5'.

the oncurrent event property of 'Adverse Events (child)' reads as follows
(and compiled successfully):
Private Sub Form_Current()
If Me.Continuing.Value = "Yes" Then
Me.Duplicate.Enabled = True
Else
Me.Duplicate.Enabled = False
End If
Me.txtCurKey1 = Me.Patient_Number
Me.txtCurKey2 = Me.Cycle
Me.txtCurKey3 = Me.AE_Description
Me.txtCurKey4 = Me.Subtype
Me.txtCurKey5 = Me.Onset
End Sub

the CF for Text51 is

[Patient Number]=[txtCurKey1] And [Cycle]=[txtCurKey2] And [AE
Description]=[txtCurKey3] And [Subtype]=[txtCurKey4] And [Onset]=[txtCurKey5]

and incorporates the 'mustard' looking fill/back color/choice, red font/fore
color and the enabled button to the right of the font/fore color is pressed,
graying out the 'format preview' when the condition is met.

what then is the reason the spectacular awaited for benefit of all this
ministering fails to materialize :-(









Marshall Barton said:
As I tried to say before, if the CF Enabled property is set
to Yes then the big text box on the form will be enabled
when the color changes. This mean that the big text box
will only be locked and can receive the focus, even if you
can not do anything to it. As soon as the text box (or any
control) receives the focus, it is automatically brought to
the front where it will obscur the other controls that were
in fornt of it. By making sure it remains disabled, we are
preventing the big text box from receiving the focus, so it
will stay behind the other controls. Clear? ;-)
--
Marsh
MVP [MS Access]


BINGO, marsh :-)

it's totally strange, i've looked at that panel dozens of times and never
noticed that sucker before. now that i have i can't help but wonder how/why
it works in this instance (as in what's it doing that we need it to do). not
totally important, my users won't care much less even know about it's service
-- just intellectually curious.

Ted wrote:
when i use locked=yes, enabled=no i don't see the greyed out appearance/look
on the big textbox; whatever, but what i guess is another hangup is this--i
haven't a clue as to how you're proposing we disable the textbox from w/in
the conditional formatting environment. unless my eyesight's going (always a
possibility), i don't see this capability in the cf formatting window thing.
my suspicion is that in addtion to this 'expression'

[Patient Number]=[txtCurKey1] And [MedNumber]=[txtCurKey2]

in the cf window, there be adjoined some vba/vbalike text which disables it.
yes?
Marshall Barton said:
No, your expression looks ok.

You won't see that appearance in the big text box on the
form. What I was referring to is the Conditional Formatting
window's Preview box.

The far right thingy in the Conditional Formatting window,
after Bold, Italic, Underline, BackColor, ForeColor, is
where you set the CF's Enabled property (it looks like a
little text box). Click the little thingy until the Preview
box is grayed out.
 
Back
Top