469,953 Members | 2,403 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,953 developers. It's quick & easy.

Conditional Formatting (for CURRENT Record !

I have 3 fields : First_Name, Last_Name & Policy_Number

I'm using a continuous form.

If I invoke conditional formatting on First_Name & set a condition of
"Prakash" (change the foreground to red), it works fine.

My Problem:
----------
What I'd like to do however is change the color of the foreground for
the CURRENT RECORD !! So That ... as I move the record pointer from
record to record, the the foreground of all three fields are red.

I have gone through the NG and noticed it is also possible to do this
using VBA code. Can someone please explain both methods of going about
this (one ... the point & click method) ... and the other (using VBA)
.... with a code example.

Thx & Best Rgds,
Prakash.
Nov 12 '05 #1
4 9586
Did you check out
http://www.lebans.com

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
"Prakash Wadhwani" <si****@omantel.net.om> wrote in message
news:60**************************@posting.google.c om...
I have 3 fields : First_Name, Last_Name & Policy_Number

I'm using a continuous form.

If I invoke conditional formatting on First_Name & set a condition of
"Prakash" (change the foreground to red), it works fine.

My Problem:
----------
What I'd like to do however is change the color of the foreground for
the CURRENT RECORD !! So That ... as I move the record pointer from
record to record, the the foreground of all three fields are red.

I have gone through the NG and noticed it is also possible to do this
using VBA code. Can someone please explain both methods of going about
this (one ... the point & click method) ... and the other (using VBA)
... with a code example.

Thx & Best Rgds,
Prakash.

Nov 12 '05 #2
The class code may be complicated, but it may not be complicated to _use_
them. That is one of the primary benefits of using classes, to hide the
complexity and make the objects simple to use.

I'll bet we would be _astonished_ at how complex an object like a Form is,
behind the scenes, but it's pretty easy to use. In fact, the Form class is
coded in a different language, C++, but we can use it in VBA and with
point-and-click.

I'd suggest taking another look at Stephen's work, to see if there isn't a
very simple way to _use_ it. I'd wager there _is_.

Larry Linson
Microsoft Access MVP

"Prakash Wadhwani" <si****@omantel.net.om> wrote in message
news:3f*********************@news.frii.net...
Hi Fred !

Yes I did check out Stephen's Site. Unfortunately he has used classes
which I know nothing about & hence find it a bit complicated and am a
wee bit hesitant to use it.

Secondly, he has colored the row outside the text editing area. I wish
to color the foreground of the text (he probably has that too ... I
don't recollect). He's put up so many examples.

Thirdly, I would like to accomplish this using the point & click
facility available for conditional formatting in Access ... or ... using
VBA ... eg:

---------
With Forms("MyForm").Controls("tbCfText").FormatConditi ons _
.Add(acFielsValue, acGreaterTyhan, "=[tb2]")
.BackColor = RGB(224,224,224) ' pale Gray
.FontBold = True
.ForeColor = RGB(64, 32,160) ' blue with a hint of purple
End With
----------
I would greatly appreciate if someone could explain the above lines to
me & demonstrate how I could change the above code to change the
foreground color of only the CURRENT RECORD ! and ... how it can change
as I move from record to record.

As a last resort if I can get nothing else to work, I may have to opt
for Stephens' Solution. It's just that I don't like incorporating code
in my programs which I don't understand. Stephen really has put up tons
of beauties at his site within the public domain. (God bless him !)

Thx & Best Rgds,
Prakash.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #3
Larry, I certainly will look into Stephen's Classes once again as
suggested by you. Could you however also *please* explain to me the
following code & how to implement it for the CURRENT record ... i'd
really appreciate that.

Also ... in which event would I need to place this code ? (probably
current event ... i'm guessing) ??
---------
With Forms("MyForm").Controls("tbCfText").FormatConditi ons _
.Add(acFielsValue, acGreaterTyhan, "=[tb2]")
.BackColor = RGB(224,224,224) ' pale Gray
.FontBold = True
.ForeColor = RGB(64, 32,160) ' blue with a hint of purple
End With
----------


Thx & Best Rgds,
Prakash.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #4
Prakash,

The continuous forms view simply does not support the use of the code you
posted. That was the reason that Conditional Formatting was added to Access
in Access 2000, and why Stephen created his workaround code/class.

There is only one "detail" defined in the continuous forms view, so certain
operations apply to every copy of it that is displayed. Only one of those
copies, BTW, is active; all the rest are just painted on the screen to show
additional bound records. This is the same reason that an unbound Control
will display the same value for every "record" displayed in continuous forms
view.

Larry Linson
Microsoft Access MVP

"Prakash Wadhwani" <si****@omantel.net.om> wrote in message
news:3f*********************@news.frii.net...
Larry, I certainly will look into Stephen's Classes once again as
suggested by you. Could you however also *please* explain to me the
following code & how to implement it for the CURRENT record ... i'd
really appreciate that.

Also ... in which event would I need to place this code ? (probably
current event ... i'm guessing) ??
---------
With Forms("MyForm").Controls("tbCfText").FormatConditi ons _
.Add(acFielsValue, acGreaterTyhan, "=[tb2]")
.BackColor = RGB(224,224,224) ' pale Gray
.FontBold = True
.ForeColor = RGB(64, 32,160) ' blue with a hint of purple
End With
----------


Thx & Best Rgds,
Prakash.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Andante.in.Blue | last post: by
4 posts views Thread by Bradley | last post: by
8 posts views Thread by Dimitri Furman | last post: by
5 posts views Thread by Andrew Chanter | last post: by
2 posts views Thread by jodyblau | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.