Conditional format on continous forms

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

Guest

I am trying to figure out how to change the font color when field value
changes. If anyone has any suggestions, I could sure use it. Thanks in
advance
 
Use Conditional Formatting. Highlight the field you want to format. On the
Menu Bar, go to Format --> Conditional Formatting. Set the conditions and
the properties that will be changed when the conditions are true.

HTH
Bryan..
 
I'm thinking I have to code the conditions because I have several records in
a row where the subject is the same and when the subject changes I want to
bold the text. Every other subject would be bold. My thinking is, and you
can tell if I wrong, that I need to loop thru the records storing the
previous subject to have somthing to compare when the subject has changed. I
know how to use the conditional format from the toolbar, just uncertain is
code could be placed there while looping thru records.
Records look like this:

Rec Subject Note
1 Fuel Member called xxxxxxxxx
2 Fuel note continues....
3 Insurance Called so n so on....
4 Insurance continued.....
5 Insurance continued....

and so on....
 
I thought your question sounded too easy. So you want the Subject field to
be bold whenever the value of Subject is different than the previous Subject?
That is a bit trickier and requires some VB.

Add a Global Variable to any module (or create a new one) to keep the old
subject.

Global strPreviousSubject As String

Below that, add the function to check to see if the line should be bold:

Function fBoldField(Optional ByVal strSubject As String) As Boolean
fBoldField = False
If IsNull(strSubject) Then Exit Function
If strSubject <> strPreviousSubject Then fBoldField = True
strPreviousSubject = strSubject
End Function

Then, for the conditional formatting of your Subject box, choose Expression
Is with

fBoldField([User])

as the expression.

Whenever the fBoldField Function returns a true value, the conditional
formatting will kick in.

Bryan..
 
Bryan thanks for helping me out. I put the code in as you described. I
selected conditional formating on my subject field on my form as the
following:

Expression Is fBoldField([User])

When I opened the form again all the records were changed to the conditional
format. Did I do something wrong?

--
Leslie


Bryan in Bakersfield said:
I thought your question sounded too easy. So you want the Subject field to
be bold whenever the value of Subject is different than the previous Subject?
That is a bit trickier and requires some VB.

Add a Global Variable to any module (or create a new one) to keep the old
subject.

Global strPreviousSubject As String

Below that, add the function to check to see if the line should be bold:

Function fBoldField(Optional ByVal strSubject As String) As Boolean
fBoldField = False
If IsNull(strSubject) Then Exit Function
If strSubject <> strPreviousSubject Then fBoldField = True
strPreviousSubject = strSubject
End Function

Then, for the conditional formatting of your Subject box, choose Expression
Is with

fBoldField([User])

as the expression.

Whenever the fBoldField Function returns a true value, the conditional
formatting will kick in.

Bryan..

Leslie said:
I'm thinking I have to code the conditions because I have several records in
a row where the subject is the same and when the subject changes I want to
bold the text. Every other subject would be bold. My thinking is, and you
can tell if I wrong, that I need to loop thru the records storing the
previous subject to have somthing to compare when the subject has changed. I
know how to use the conditional format from the toolbar, just uncertain is
code could be placed there while looping thru records.
Records look like this:

Rec Subject Note
1 Fuel Member called xxxxxxxxx
2 Fuel note continues....
3 Insurance Called so n so on....
4 Insurance continued.....
5 Insurance continued....

and so on....
 
Sorry Bryan, I just needed to rename [User] to my field. It works great.
Thanks again for helping.
--
Leslie


Leslie said:
Bryan thanks for helping me out. I put the code in as you described. I
selected conditional formating on my subject field on my form as the
following:

Expression Is fBoldField([User])

When I opened the form again all the records were changed to the conditional
format. Did I do something wrong?

--
Leslie


Bryan in Bakersfield said:
I thought your question sounded too easy. So you want the Subject field to
be bold whenever the value of Subject is different than the previous Subject?
That is a bit trickier and requires some VB.

Add a Global Variable to any module (or create a new one) to keep the old
subject.

Global strPreviousSubject As String

Below that, add the function to check to see if the line should be bold:

Function fBoldField(Optional ByVal strSubject As String) As Boolean
fBoldField = False
If IsNull(strSubject) Then Exit Function
If strSubject <> strPreviousSubject Then fBoldField = True
strPreviousSubject = strSubject
End Function

Then, for the conditional formatting of your Subject box, choose Expression
Is with

fBoldField([User])

as the expression.

Whenever the fBoldField Function returns a true value, the conditional
formatting will kick in.

Bryan..

Leslie said:
I'm thinking I have to code the conditions because I have several records in
a row where the subject is the same and when the subject changes I want to
bold the text. Every other subject would be bold. My thinking is, and you
can tell if I wrong, that I need to loop thru the records storing the
previous subject to have somthing to compare when the subject has changed. I
know how to use the conditional format from the toolbar, just uncertain is
code could be placed there while looping thru records.
Records look like this:

Rec Subject Note
1 Fuel Member called xxxxxxxxx
2 Fuel note continues....
3 Insurance Called so n so on....
4 Insurance continued.....
5 Insurance continued....

and so on....

--
Leslie


:

Use Conditional Formatting. Highlight the field you want to format. On the
Menu Bar, go to Format --> Conditional Formatting. Set the conditions and
the properties that will be changed when the conditions are true.

HTH
Bryan..

:

I am trying to figure out how to change the font color when field value
changes. If anyone has any suggestions, I could sure use it. Thanks in
advance
 
Back
Top