Is there an alternative to the ‘Conditional Formatting’ facility

E

efandango

Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])
 
E

efandango

Daniel,

that link doesn't work?...

I don't mind you using code if anyone has any ideas on how.

Daniel said:
You're going to have to use code to achieve this effect. take a look at

http://localhost/web/CARDA/en/msaccess.php?lang=en&id=0000000011#chgBkgrndColor

The 'Changing a Form/Report Background Color' section. you can basically
specify any color you want this way.
--
Hope this helps,

Daniel P





efandango said:
Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])
 
6

'69 Camaro

Hi, Daniel
You're going to have to use code to achieve this effect. take a look at

http://localhost/web/CARDA/en/msaccess.php?lang=en&id=0000000011#chgBkgrndColor

That address will only work on your workstation.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.


Daniel said:
You're going to have to use code to achieve this effect. take a look at

http://localhost/web/CARDA/en/msaccess.php?lang=en&id=0000000011#chgBkgrndColor

The 'Changing a Form/Report Background Color' section. you can basically
specify any color you want this way.
--
Hope this helps,

Daniel P





efandango said:
Is there an alternative to the 'Conditional Formatting' facility, the
problem
is that I want to use the standard light grey background colour for my
text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])
 
M

Marshall Barton

efandango said:
Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])


The code in the form"s Open event would be like:

Me.textbox.FormatConditions(0).BackColor = colornum

Where colornum is the value in the text box section's
BackColor property
 
E

efandango

Marshall,

I wanted to use the background colour for a 'Conditional Formatting' box,
based on a condition, not on a form open situation. I hope I have interpreted
your answer correctly.
This is the code I have in my 'Conditonal Formatting' feature:

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])

So how would I use that in a:

If my [controlname] IsNull then make it this background Colour (MS Access
Lightest Grey)?

or have i completely missunderstood your response, apologies if that it the
case.

regards

Eric



Marshall Barton said:
efandango said:
Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])


The code in the form"s Open event would be like:

Me.textbox.FormatConditions(0).BackColor = colornum

Where colornum is the value in the text box section's
BackColor property
 
M

Marshall Barton

Well, you did misunderstand, but I didn't provide more than
the bare essentials either. That line of code will set the
BackColor of the first conditional format for the textbox.
This is needed because the CF color picker does not provide
the color you want. The Open event is just a convenient
place to manipulate the CF properties.

Use Copy/Paste from the section's BackColor property
(probably a negative number) to replace "colornum" in the
code. The Negative color codes tell Access to get the color
from Windows' Display Property Settings. Search Help for
System Colors for a list of these color codes. Positive
color numbers are easiest to create using the RGB function.
--
Marsh
MVP [MS Access]

I wanted to use the background colour for a 'Conditional Formatting' box,
based on a condition, not on a form open situation. I hope I have interpreted
your answer correctly.
This is the code I have in my 'Conditonal Formatting' feature:

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])

So how would I use that in a:

If my [controlname] IsNull then make it this background Colour (MS Access
Lightest Grey)?

or have i completely missunderstood your response, apologies if that it the
case.


Marshall Barton said:
efandango said:
Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])


The code in the form"s Open event would be like:

Me.textbox.FormatConditions(0).BackColor = colornum

Where colornum is the value in the text box section's
BackColor property
 
E

efandango

Thanks for the explanation Marshall,

It worked; though I have a slight problem in that there are 2 different
control boxes relating to the same record, but only when the second control
code is executed do both controls turn to the required grey colour. These are
the 2 code segments, have you any idea what is going wrong?.

If (Forms.Runs.[frm_Run_Test].Form.[Direction_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_Direction]) Then

Me.Direction_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Direction Selection Control
End If


If (Forms.Runs.[frm_Run_Test].Form.[Waypoint_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_waypoint]) Then

Me.Waypoint_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Waypoint Selection Control
End If



Marshall Barton said:
Well, you did misunderstand, but I didn't provide more than
the bare essentials either. That line of code will set the
BackColor of the first conditional format for the textbox.
This is needed because the CF color picker does not provide
the color you want. The Open event is just a convenient
place to manipulate the CF properties.

Use Copy/Paste from the section's BackColor property
(probably a negative number) to replace "colornum" in the
code. The Negative color codes tell Access to get the color
from Windows' Display Property Settings. Search Help for
System Colors for a list of these color codes. Positive
color numbers are easiest to create using the RGB function.
--
Marsh
MVP [MS Access]

I wanted to use the background colour for a 'Conditional Formatting' box,
based on a condition, not on a form open situation. I hope I have interpreted
your answer correctly.
This is the code I have in my 'Conditonal Formatting' feature:

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])

So how would I use that in a:

If my [controlname] IsNull then make it this background Colour (MS Access
Lightest Grey)?

or have i completely missunderstood your response, apologies if that it the
case.


Marshall Barton said:
efandango wrote:

Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])


The code in the form"s Open event would be like:

Me.textbox.FormatConditions(0).BackColor = colornum

Where colornum is the value in the text box section's
BackColor property
 
E

efandango

Marshall,

With reference to my last reply, another question arises; which is 'Will
your code only work if the Conditional Format' is set to something, in this
case 'IsNull([Waypoint_Selector])' allows the code to work, but if I remove
the conditional formatting, the code process fails. Is this a big, or have i
not realised that you need Conditional Formatting turned on for the code to
work?, if so,does this segment from you code 'FormatConditions(0).' relate to
it?

efandango said:
Thanks for the explanation Marshall,

It worked; though I have a slight problem in that there are 2 different
control boxes relating to the same record, but only when the second control
code is executed do both controls turn to the required grey colour. These are
the 2 code segments, have you any idea what is going wrong?.

If (Forms.Runs.[frm_Run_Test].Form.[Direction_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_Direction]) Then

Me.Direction_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Direction Selection Control
End If


If (Forms.Runs.[frm_Run_Test].Form.[Waypoint_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_waypoint]) Then

Me.Waypoint_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Waypoint Selection Control
End If



Marshall Barton said:
Well, you did misunderstand, but I didn't provide more than
the bare essentials either. That line of code will set the
BackColor of the first conditional format for the textbox.
This is needed because the CF color picker does not provide
the color you want. The Open event is just a convenient
place to manipulate the CF properties.

Use Copy/Paste from the section's BackColor property
(probably a negative number) to replace "colornum" in the
code. The Negative color codes tell Access to get the color
from Windows' Display Property Settings. Search Help for
System Colors for a list of these color codes. Positive
color numbers are easiest to create using the RGB function.
--
Marsh
MVP [MS Access]

I wanted to use the background colour for a 'Conditional Formatting' box,
based on a condition, not on a form open situation. I hope I have interpreted
your answer correctly.
This is the code I have in my 'Conditonal Formatting' feature:

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])

So how would I use that in a:

If my [controlname] IsNull then make it this background Colour (MS Access
Lightest Grey)?

or have i completely missunderstood your response, apologies if that it the
case.


:

efandango wrote:

Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])


The code in the form"s Open event would be like:

Me.textbox.FormatConditions(0).BackColor = colornum

Where colornum is the value in the text box section's
BackColor property
 
M

Marshall Barton

This entire concept is based on getting CF to use the right
color. You will not get anywhere without using CF.

Using those If statements is destroying what we are trying
to do with CF so get rid of them. I have no idea what you
are trying to accomplish by using those If statements.
Unless you are changing your mind about what you want to do,
I am still assuming that you want the special color in
Waypoint_Selector when it is Null, so set WayPoint
Conditional Formatting to:
IsNull([Waypoint_Selector])
and use this one line of code in the Open event procedure:
Me.Waypoint_Selector.FormatConditions(0).BackColor=-2147483633

It's not clear to me when you want the Direction_Selector
control (text box?) to use the special color, but it seems
like you want to set this control's CF Expression to:
IsNull([Direction_Selector])
and add this line of code:
Me.Direction_Selector.FormatConditions(0).BackColor=-2147483633
to the Open event in the form that contains the
Direction_Selector control.
--
Marsh
MVP [MS Access]

With reference to my last reply, another question arises; which is 'Will
your code only work if the Conditional Format' is set to something, in this
case 'IsNull([Waypoint_Selector])' allows the code to work, but if I remove
the conditional formatting, the code process fails. Is this a big, or have i
not realised that you need Conditional Formatting turned on for the code to
work?, if so,does this segment from you code 'FormatConditions(0).' relate to
it?

efandango said:
It worked; though I have a slight problem in that there are 2 different
control boxes relating to the same record, but only when the second control
code is executed do both controls turn to the required grey colour. These are
the 2 code segments, have you any idea what is going wrong?.

If (Forms.Runs.[frm_Run_Test].Form.[Direction_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_Direction]) Then

Me.Direction_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Direction Selection Control
End If


If (Forms.Runs.[frm_Run_Test].Form.[Waypoint_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_waypoint]) Then

Me.Waypoint_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Waypoint Selection Control
End If



Marshall Barton said:
Well, you did misunderstand, but I didn't provide more than
the bare essentials either. That line of code will set the
BackColor of the first conditional format for the textbox.
This is needed because the CF color picker does not provide
the color you want. The Open event is just a convenient
place to manipulate the CF properties.

Use Copy/Paste from the section's BackColor property
(probably a negative number) to replace "colornum" in the
code. The Negative color codes tell Access to get the color
from Windows' Display Property Settings. Search Help for
System Colors for a list of these color codes. Positive
color numbers are easiest to create using the RGB function.


efandango wrote:
I wanted to use the background colour for a 'Conditional Formatting' box,
based on a condition, not on a form open situation. I hope I have interpreted
your answer correctly.
This is the code I have in my 'Conditonal Formatting' feature:

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])

So how would I use that in a:

If my [controlname] IsNull then make it this background Colour (MS Access
Lightest Grey)?

or have i completely missunderstood your response, apologies if that it the
case.


:

efandango wrote:

Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])


The code in the form"s Open event would be like:

Me.textbox.FormatConditions(0).BackColor = colornum

Where colornum is the value in the text box section's
BackColor property
 
E

efandango

Marshall,

I'm trying to do the following: (it's all in the last paragraph).

I have a series of lists of addresses on a form that I want to transfer to
another form when the user clicks on an address. Eventually creating a new
correct list.

The target address list must ultimately be in the correct order; the
challenge is for the user to select the addresses in that order.

The way I want the form to work is to have two forms, the form on the left
will be the Target Form, and the form on the right is the Selector Form. Both
Forms are continuous forms because each list of addresses are different
lengths.

The twist is that the Selector form addresses will be in a random order, and
by the user clicking on a selection, that address will be transferred to the
Target Form list. Eventually all available selections will be chosen, making
a complete list.

This all works fine now, so each time the user selects a candidate address
for the target form, and assuming it is correct, the selected address 'greys
out' leaving an ever diminishing list until there are no more addresses in
the Selector Form. That is what the 'If...then backcolour' statements are
doing. If the CF was capable of displaying 'system colours' I wouldn't need
the If... statements. However, It all works very elegently now, with the
'If...' statements; but significantly without the the CF code.

I hope this all makes sense.



Marshall Barton said:
This entire concept is based on getting CF to use the right
color. You will not get anywhere without using CF.

Using those If statements is destroying what we are trying
to do with CF so get rid of them. I have no idea what you
are trying to accomplish by using those If statements.
Unless you are changing your mind about what you want to do,
I am still assuming that you want the special color in
Waypoint_Selector when it is Null, so set WayPoint
Conditional Formatting to:
IsNull([Waypoint_Selector])
and use this one line of code in the Open event procedure:
Me.Waypoint_Selector.FormatConditions(0).BackColor=-2147483633

It's not clear to me when you want the Direction_Selector
control (text box?) to use the special color, but it seems
like you want to set this control's CF Expression to:
IsNull([Direction_Selector])
and add this line of code:
Me.Direction_Selector.FormatConditions(0).BackColor=-2147483633
to the Open event in the form that contains the
Direction_Selector control.
--
Marsh
MVP [MS Access]

With reference to my last reply, another question arises; which is 'Will
your code only work if the Conditional Format' is set to something, in this
case 'IsNull([Waypoint_Selector])' allows the code to work, but if I remove
the conditional formatting, the code process fails. Is this a big, or have i
not realised that you need Conditional Formatting turned on for the code to
work?, if so,does this segment from you code 'FormatConditions(0).' relate to
it?

efandango said:
It worked; though I have a slight problem in that there are 2 different
control boxes relating to the same record, but only when the second control
code is executed do both controls turn to the required grey colour. These are
the 2 code segments, have you any idea what is going wrong?.

If (Forms.Runs.[frm_Run_Test].Form.[Direction_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_Direction]) Then

Me.Direction_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Direction Selection Control
End If


If (Forms.Runs.[frm_Run_Test].Form.[Waypoint_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_waypoint]) Then

Me.Waypoint_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Waypoint Selection Control
End If



:

Well, you did misunderstand, but I didn't provide more than
the bare essentials either. That line of code will set the
BackColor of the first conditional format for the textbox.
This is needed because the CF color picker does not provide
the color you want. The Open event is just a convenient
place to manipulate the CF properties.

Use Copy/Paste from the section's BackColor property
(probably a negative number) to replace "colornum" in the
code. The Negative color codes tell Access to get the color
from Windows' Display Property Settings. Search Help for
System Colors for a list of these color codes. Positive
color numbers are easiest to create using the RGB function.


efandango wrote:
I wanted to use the background colour for a 'Conditional Formatting' box,
based on a condition, not on a form open situation. I hope I have interpreted
your answer correctly.
This is the code I have in my 'Conditonal Formatting' feature:

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])

So how would I use that in a:

If my [controlname] IsNull then make it this background Colour (MS Access
Lightest Grey)?

or have i completely missunderstood your response, apologies if that it the
case.


:

efandango wrote:

Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])


The code in the form"s Open event would be like:

Me.textbox.FormatConditions(0).BackColor = colornum

Where colornum is the value in the text box section's
BackColor property
 
M

Marshall Barton

I think I understand most of what you are trying to do, but
those If statements are meaningless at best and might defeat
the objective at worst. You can only set the CF color for a
control or not set it. If you don't set it, it won't use
the special color. If you do set it, then it applies to
every record being displayed on the form. Therefore, you
should either dump the If and just assign the CF color or
you should dump the If and the assignment statement. either
way the If part is at best meaningless.
--
Marsh
MVP [MS Access]

I'm trying to do the following: (it's all in the last paragraph).

I have a series of lists of addresses on a form that I want to transfer to
another form when the user clicks on an address. Eventually creating a new
correct list.

The target address list must ultimately be in the correct order; the
challenge is for the user to select the addresses in that order.

The way I want the form to work is to have two forms, the form on the left
will be the Target Form, and the form on the right is the Selector Form. Both
Forms are continuous forms because each list of addresses are different
lengths.

The twist is that the Selector form addresses will be in a random order, and
by the user clicking on a selection, that address will be transferred to the
Target Form list. Eventually all available selections will be chosen, making
a complete list.

This all works fine now, so each time the user selects a candidate address
for the target form, and assuming it is correct, the selected address 'greys
out' leaving an ever diminishing list until there are no more addresses in
the Selector Form. That is what the 'If...then backcolour' statements are
doing. If the CF was capable of displaying 'system colours' I wouldn't need
the If... statements. However, It all works very elegently now, with the
'If...' statements; but significantly without the the CF code.

I hope this all makes sense.


Marshall Barton said:
This entire concept is based on getting CF to use the right
color. You will not get anywhere without using CF.

Using those If statements is destroying what we are trying
to do with CF so get rid of them. I have no idea what you
are trying to accomplish by using those If statements.
Unless you are changing your mind about what you want to do,
I am still assuming that you want the special color in
Waypoint_Selector when it is Null, so set WayPoint
Conditional Formatting to:
IsNull([Waypoint_Selector])
and use this one line of code in the Open event procedure:
Me.Waypoint_Selector.FormatConditions(0).BackColor=-2147483633

It's not clear to me when you want the Direction_Selector
control (text box?) to use the special color, but it seems
like you want to set this control's CF Expression to:
IsNull([Direction_Selector])
and add this line of code:
Me.Direction_Selector.FormatConditions(0).BackColor=-2147483633
to the Open event in the form that contains the
Direction_Selector control.

With reference to my last reply, another question arises; which is 'Will
your code only work if the Conditional Format' is set to something, in this
case 'IsNull([Waypoint_Selector])' allows the code to work, but if I remove
the conditional formatting, the code process fails. Is this a big, or have i
not realised that you need Conditional Formatting turned on for the code to
work?, if so,does this segment from you code 'FormatConditions(0).' relate to
it?

:
It worked; though I have a slight problem in that there are 2 different
control boxes relating to the same record, but only when the second control
code is executed do both controls turn to the required grey colour. These are
the 2 code segments, have you any idea what is going wrong?.

If (Forms.Runs.[frm_Run_Test].Form.[Direction_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_Direction]) Then

Me.Direction_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Direction Selection Control
End If


If (Forms.Runs.[frm_Run_Test].Form.[Waypoint_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_waypoint]) Then

Me.Waypoint_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Waypoint Selection Control
End If



:

Well, you did misunderstand, but I didn't provide more than
the bare essentials either. That line of code will set the
BackColor of the first conditional format for the textbox.
This is needed because the CF color picker does not provide
the color you want. The Open event is just a convenient
place to manipulate the CF properties.

Use Copy/Paste from the section's BackColor property
(probably a negative number) to replace "colornum" in the
code. The Negative color codes tell Access to get the color
from Windows' Display Property Settings. Search Help for
System Colors for a list of these color codes. Positive
color numbers are easiest to create using the RGB function.


efandango wrote:
I wanted to use the background colour for a 'Conditional Formatting' box,
based on a condition, not on a form open situation. I hope I have interpreted
your answer correctly.
This is the code I have in my 'Conditonal Formatting' feature:

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])

So how would I use that in a:

If my [controlname] IsNull then make it this background Colour (MS Access
Lightest Grey)?

or have i completely missunderstood your response, apologies if that it the
case.


:

efandango wrote:

Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])


The code in the form"s Open event would be like:

Me.textbox.FormatConditions(0).BackColor = colornum

Where colornum is the value in the text box section's
BackColor property
 
M

missinglinq via AccessMonster.com

I'm confused by the original post! What version of Access are you using? In
Access 2000 the light gray color that's the standard textbox background color
is indeed available in the color picker, I use it all the time! M$ even
suggests this as a way to "blank out" a textbox conditionally!
 
M

Marshall Barton

missinglinq said:
I'm confused by the original post! What version of Access are you using? In
Access 2000 the light gray color that's the standard textbox background color
is indeed available in the color picker, I use it all the time! M$ even
suggests this as a way to "blank out" a textbox conditionally!


The colors available in the color pickers are all RGB
values. The default colors used for several form elements
are system color codes (negative numbers), not RGB values.
The system color codes are used to represent the colors that
you can specify using the Windows - Display Properties -
Appearance - Advanced settings that affect all windows.

To maintain a consistent color scheme across all
applications, you should use the system colors for almost
all color properties in Access. This way, if a user has a
windows color scheme that is not the basic gray, your app
(and the gray text box) will not stick out like a sore
thumb.

You can find a list of the System Color codes in VBA Help.
 
E

efandango

Marshall,

I hear what you say with regards to the If statements, but here's the weird
bit.... both controls work perfectly, as does now the CF Form Open code that
you provided: Here is it in full (for both controls):

Private Sub Form_Open(Cancel As Integer)
Me.Waypoint_Selector.FormatConditions(0).BackColor = -2147483633
Me.Direction_Selector.FormatConditions(0).BackColor = -2147483633
End Sub

I have off course removed the two Ifs as you suggested and gone with your
solution as it seems simpler, proper and should be less hassle in the long
term.

Just for the record, the If's related events occur with no discernable
problems to the Form or Database. So without doubting you or your abilities
and far greater knowledge than myself for a moment, I’m puzzled as to why you
seem so adamant about not using that particular If procedure. Also being the
noviec that I am, how is your code actually ensuring that I get the Light
System Grey on those controls. Is it the (0) that is saying make the ‘0’
designated colour = LSG


As always, I greatly appreciate your help on this forum.

Regards

Eric



efandango said:
Marshall,

I'm trying to do the following: (it's all in the last paragraph).

I have a series of lists of addresses on a form that I want to transfer to
another form when the user clicks on an address. Eventually creating a new
correct list.

The target address list must ultimately be in the correct order; the
challenge is for the user to select the addresses in that order.

The way I want the form to work is to have two forms, the form on the left
will be the Target Form, and the form on the right is the Selector Form. Both
Forms are continuous forms because each list of addresses are different
lengths.

The twist is that the Selector form addresses will be in a random order, and
by the user clicking on a selection, that address will be transferred to the
Target Form list. Eventually all available selections will be chosen, making
a complete list.

This all works fine now, so each time the user selects a candidate address
for the target form, and assuming it is correct, the selected address 'greys
out' leaving an ever diminishing list until there are no more addresses in
the Selector Form. That is what the 'If...then backcolour' statements are
doing. If the CF was capable of displaying 'system colours' I wouldn't need
the If... statements. However, It all works very elegently now, with the
'If...' statements; but significantly without the the CF code.

I hope this all makes sense.



Marshall Barton said:
This entire concept is based on getting CF to use the right
color. You will not get anywhere without using CF.

Using those If statements is destroying what we are trying
to do with CF so get rid of them. I have no idea what you
are trying to accomplish by using those If statements.
Unless you are changing your mind about what you want to do,
I am still assuming that you want the special color in
Waypoint_Selector when it is Null, so set WayPoint
Conditional Formatting to:
IsNull([Waypoint_Selector])
and use this one line of code in the Open event procedure:
Me.Waypoint_Selector.FormatConditions(0).BackColor=-2147483633

It's not clear to me when you want the Direction_Selector
control (text box?) to use the special color, but it seems
like you want to set this control's CF Expression to:
IsNull([Direction_Selector])
and add this line of code:
Me.Direction_Selector.FormatConditions(0).BackColor=-2147483633
to the Open event in the form that contains the
Direction_Selector control.
--
Marsh
MVP [MS Access]

With reference to my last reply, another question arises; which is 'Will
your code only work if the Conditional Format' is set to something, in this
case 'IsNull([Waypoint_Selector])' allows the code to work, but if I remove
the conditional formatting, the code process fails. Is this a big, or have i
not realised that you need Conditional Formatting turned on for the code to
work?, if so,does this segment from you code 'FormatConditions(0).' relate to
it?

:
It worked; though I have a slight problem in that there are 2 different
control boxes relating to the same record, but only when the second control
code is executed do both controls turn to the required grey colour. These are
the 2 code segments, have you any idea what is going wrong?.

If (Forms.Runs.[frm_Run_Test].Form.[Direction_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_Direction]) Then

Me.Direction_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Direction Selection Control
End If


If (Forms.Runs.[frm_Run_Test].Form.[Waypoint_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_waypoint]) Then

Me.Waypoint_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Waypoint Selection Control
End If



:

Well, you did misunderstand, but I didn't provide more than
the bare essentials either. That line of code will set the
BackColor of the first conditional format for the textbox.
This is needed because the CF color picker does not provide
the color you want. The Open event is just a convenient
place to manipulate the CF properties.

Use Copy/Paste from the section's BackColor property
(probably a negative number) to replace "colornum" in the
code. The Negative color codes tell Access to get the color
from Windows' Display Property Settings. Search Help for
System Colors for a list of these color codes. Positive
color numbers are easiest to create using the RGB function.


efandango wrote:
I wanted to use the background colour for a 'Conditional Formatting' box,
based on a condition, not on a form open situation. I hope I have interpreted
your answer correctly.
This is the code I have in my 'Conditonal Formatting' feature:

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])

So how would I use that in a:

If my [controlname] IsNull then make it this background Colour (MS Access
Lightest Grey)?

or have i completely missunderstood your response, apologies if that it the
case.


:

efandango wrote:

Is there an alternative to the ‘Conditional Formatting’ facility, the problem
is that I want to use the standard light grey background colour for my text
box (effectively making it invisible. But that particular shade is not
available in the colour picker on this feature. So how would I express it
with a numerical equivalent?

My Expression for the Conditional box at the moment is:

IsNull([Waypoint_Selector])


The code in the form"s Open event would be like:

Me.textbox.FormatConditions(0).BackColor = colornum

Where colornum is the value in the text box section's
BackColor property
 
M

Marshall Barton

efandango said:
I hear what you say with regards to the If statements, but here's the weird
bit.... both controls work perfectly, as does now the CF Form Open code that
you provided: Here is it in full (for both controls):

Private Sub Form_Open(Cancel As Integer)
Me.Waypoint_Selector.FormatConditions(0).BackColor = -2147483633
Me.Direction_Selector.FormatConditions(0).BackColor = -2147483633
End Sub

That's good. Remember that the only job that code is
performing is to set the CF color to something you can not
set using the color picker.

I have off course removed the two Ifs as you suggested and gone with your
solution as it seems simpler, proper and should be less hassle in the long
term.

Right, it is simpler. It will certainly be less hassle in
any situation where the If condition is false.
Just for the record, the If's related events occur with no discernable
problems to the Form or Database. So without doubting you or your abilities
and far greater knowledge than myself for a moment, I’m puzzled as to why you
seem so adamant about not using that particular If procedure. Also being the
noviec that I am, how is your code actually ensuring that I get the Light
System Grey on those controls. Is it the (0) that is saying make the ‘0’
designated colour = LSG

As I said above, the code doesn't do anything except set the
CF color property to a color that's not available in the
picker.

The thing that determines when to use the color is the
expression you specified in the CF Expression Is: option.
--
Marsh
MVP [MS Access]
efandango said:
I'm trying to do the following: (it's all in the last paragraph).

I have a series of lists of addresses on a form that I want to transfer to
another form when the user clicks on an address. Eventually creating a new
correct list.

The target address list must ultimately be in the correct order; the
challenge is for the user to select the addresses in that order.

The way I want the form to work is to have two forms, the form on the left
will be the Target Form, and the form on the right is the Selector Form. Both
Forms are continuous forms because each list of addresses are different
lengths.

The twist is that the Selector form addresses will be in a random order, and
by the user clicking on a selection, that address will be transferred to the
Target Form list. Eventually all available selections will be chosen, making
a complete list.

This all works fine now, so each time the user selects a candidate address
for the target form, and assuming it is correct, the selected address 'greys
out' leaving an ever diminishing list until there are no more addresses in
the Selector Form. That is what the 'If...then backcolour' statements are
doing. If the CF was capable of displaying 'system colours' I wouldn't need
the If... statements. However, It all works very elegently now, with the
'If...' statements; but significantly without the the CF code.


Marshall Barton said:
This entire concept is based on getting CF to use the right
color. You will not get anywhere without using CF.

Using those If statements is destroying what we are trying
to do with CF so get rid of them. I have no idea what you
are trying to accomplish by using those If statements.
Unless you are changing your mind about what you want to do,
I am still assuming that you want the special color in
Waypoint_Selector when it is Null, so set WayPoint
Conditional Formatting to:
IsNull([Waypoint_Selector])
and use this one line of code in the Open event procedure:
Me.Waypoint_Selector.FormatConditions(0).BackColor=-2147483633

It's not clear to me when you want the Direction_Selector
control (text box?) to use the special color, but it seems
like you want to set this control's CF Expression to:
IsNull([Direction_Selector])
and add this line of code:
Me.Direction_Selector.FormatConditions(0).BackColor=-2147483633
to the Open event in the form that contains the
Direction_Selector control.

efandango wrote:
With reference to my last reply, another question arises; which is 'Will
your code only work if the Conditional Format' is set to something, in this
case 'IsNull([Waypoint_Selector])' allows the code to work, but if I remove
the conditional formatting, the code process fails. Is this a big, or have i
not realised that you need Conditional Formatting turned on for the code to
work?, if so,does this segment from you code 'FormatConditions(0).' relate to
it?

:
It worked; though I have a slight problem in that there are 2 different
control boxes relating to the same record, but only when the second control
code is executed do both controls turn to the required grey colour. These are
the 2 code segments, have you any idea what is going wrong?.

If (Forms.Runs.[frm_Run_Test].Form.[Direction_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_Direction]) Then

Me.Direction_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Direction Selection Control
End If


If (Forms.Runs.[frm_Run_Test].Form.[Waypoint_Combo] =
Forms.Runs.[frm_Run_Test].Form.[Run_waypoint]) Then

Me.Waypoint_Selector.FormatConditions(0).BackColor = -2147483633
'This Changes the background for the Waypoint Selection Control
End If
 

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