473,796 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9801
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.goo gle.com...
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******** *************@n ews.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("tbCf Text").FormatCo nditions _
.Add(acFielsVal ue, 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("tbCf Text").FormatCo nditions _
.Add(acFielsVal ue, 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******** *************@n ews.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("tbCf Text").FormatCo nditions _
.Add(acFielsVal ue, 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
5370
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 marked as deleted. I understand the conditional formatting is available in Access 2000 for this purpose, but it is not in 97. Is there a way to emulate this effect through code? Thanks for any input on this matter. Alan
4
3141
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 background colour. In A2000 it works great, but in A2003 the background doesn't always change and when it does it only changes when the record looses the focus. Any way around this? Is it a bug? Or have they "improved" it?
1
2243
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 another favourite: Can you highlight the current record using conditional formatting.
8
12056
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 expressions are the same for all controls Under some undetermined circumstances, when such subform is displayed, the controls on the subform start to visibly flicker, the cursor in the subform stops blinking, and CPU utilization goes to 100%....
3
2318
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 five weeks of sales for each category by using a conditonal format to highlight these top five weeks. I've been trying to find a way to do this but have not been sucessful looking through many books on Access and in reading the user groups. If...
5
8972
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 on white, the third on gray etc etc.) I could write an expression based on the odd/even status of the primary key but this wont work when sorting and filtering is applied. Any suggestions gratefully received.
2
2353
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 on. I have a second table that contains a list of tasks to be performed and relates to the Case_List through a Case_ID. So currently, I can bring up a form that has a list of all my cases, I can then select a case and it opens a new form that...
8
8511
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 perfectly. However, I have code that runs under the ON CLICK event. The code changes the focus to other controls, which means the conditional formatting is no longer displayed. This part makes sense to me. Here's what doesn't make sense. The last...
11
3494
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 conditional formatting... this poses a problem because it is extremely limited (no wildcards, cannot access controls other than the one the formatting is on, cannot perform evaluations other than the ones give... greater than, less than etc). Is there a...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9531
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.