473,396 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 9779
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andante.in.Blue | last post by:
Hello everyone! I'm building a form in Access 97 and I want to to show a special icon if the record has been marked as deleted. Obviously, I don't want the icon to show if the record was not...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
1
by: WindAndWaves | last post by:
Hey Folks I seem to be asking millions of questions. Truth is, I just discovered this awesome research and having been typing by myself for years the questions are all coming out. Here is...
8
by: Dimitri Furman | last post by:
Given: Access 2002/2003 A subform in datasheet or continuous view, placed on a tab page (this last may or may not matter) Conditional formatting applied to some controls on the subform - format...
3
by: Chuck Reed | last post by:
I am working on a sales report where I show weekly sales by category for each of the 52 weeks in the year. Each record in my table/report has the 52 weeks of sales in it. I want to highlight to top...
5
by: Andrew Chanter | last post by:
Does anyone know a way you can use conditional formatting to create a banded style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd...
2
by: jodyblau | last post by:
I'm not certain that what I am trying to do is possible; in any event I haven't been able to figure it out. Here is what I am trying to do: I have one table that has a list of cases I'm working...
8
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works...
11
by: tg989 | last post by:
Okay, here goes. Continuous forms... possibly the best feature of access. The only downside is this: the only way to have a conditional evaluation run on each record invididually is by...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.