473,802 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conditional Formatting in Forms in A97

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
Nov 12 '05 #1
3 5370
I assume you have a checkbox or something like that to flag the recorded
as deleted (called say, chkDeleted) ?

Put an extra label control with a caption of 'Deleted', formatted as you
wish (Size,Colour etc) called say, lblDeleted.

When your checkbox or whatever is updated use the AfterUpdate event
procedure to make the label Visible or Invisible.

To get to the event procedure, right click the control and display
Properties, then show Event Properties. Click into the AfterUpdate event
property. On the dropdown list choose 'Event Procedure' then click the
build button (...) to the right of the event proerty box.

if me.chkDeleted = true then
me.lblDeleted.v isible = true
else
me.lblDeleted.v isible = false
end if

You will also need to put the same code into the On Current event
procedure for the form.
Regards

Peter Russell


Andante.in.Blue previously wrote:
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


Nov 12 '05 #2
Thanks for the reply Peter, but I had forgotten to mention that my
form is in continuous mode, so using that bit of code would cause all
the visible records to display the same icon. If I have 5 records
showing, and I move into a "deleted" record, the "deleted icon" will
show up on all 5 records regardless of whether or not the other 4
records were "deleted".

I did stumble across a possible solution shortly after I posted though
(don't you just hate it when that happens?):
http://www.mvps.org/access/forms/frm0024.htm
This provides an alternative to conditional formatting that allows you
to customize text displays depending on a stored or queried boolean
value (i.e. a yes / no field).

This should solve my original problem, but I have an alternative
question then: what if I want the current record to be highlighted
with a rectangle around the border?

Here is the rationale of why I want this -- the continuous form that I
mentioned has buttons at the header that perform operations based on
the current record. But when I manipulate the controls in the header,
the current record loses focus, and it becomes difficult to see which
record you are about to affect. I would like the current record to
remain "highlighte d" even when it has lost focus. I wanted to do this
by setting the rectangle's visible proper via the onGotFocus and
onLostFocus events, but changing the rectangle's properties has a
global effect on all such rectangles on each record. Is there anyway
to get around this?

Sorry about my lack of foresight and my long post. Thanks for any
input on this.

Alan

pr******@russel lscott.co.uk (Peter Russell) wrote in message news:<me******* *************** *@russellscott. btinternet.com> ...
I assume you have a checkbox or something like that to flag the recorded
as deleted (called say, chkDeleted) ?

Put an extra label control with a caption of 'Deleted', formatted as you
wish (Size,Colour etc) called say, lblDeleted.

When your checkbox or whatever is updated use the AfterUpdate event
procedure to make the label Visible or Invisible.

To get to the event procedure, right click the control and display
Properties, then show Event Properties. Click into the AfterUpdate event
property. On the dropdown list choose 'Event Procedure' then click the
build button (...) to the right of the event proerty box.

if me.chkDeleted = true then
me.lblDeleted.v isible = true
else
me.lblDeleted.v isible = false
end if

You will also need to put the same code into the On Current event
procedure for the form.
Regards

Peter Russell

Nov 12 '05 #3
Andante.in.Blue previously wrote:
This should solve my original problem, but I have an alternative
question then: what if I want the current record to be highlighted
with a rectangle around the border?


You can use a similar technique, putting a rectangle behind all the
controls and setting the colour.

The best place for solutions to this type of problem is here:

www.lebans.com

There are demo files for 'conditional formatting' simulation for A97.

Regards
Peter Russell
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6884
by: brAccess | last post by:
I recently installed Access 2003 and immediately noticed problems with applications that work fine in 2000 and XP. I use conditional formatting on continuous forms for a number of reasons. When these forms are opened in 2003, Access seems to go into a continuous loop. Has anyone else experienced this problem? Does anyone know of a solution short of not using conditional formatting in continuous forms? Here is an example:
2
5839
by: Megan | last post by:
Can you write conditional VBA code that affects only one or two records on a continuous subform? I have a form with a subform on it. The parent/ child field that links the forms is CaseID. The main form has personal info on it. The subform deals with each case's Issues, Decisions, and Notices. Issues, Decisions, and Notices are all combo boxes. Not all Issues have Notices. Issues 25-50 have Notices. Issues 1-24 and 51-100 don't have...
5
2373
by: John Baker | last post by:
Hi: I have a field that i wish to use the conditional format capability on, and for some reason it wont work. The field is a a text box: =- I would like to make it red when negative, and have been working with the conditional
0
657
by: GGerard | last post by:
Hello With MSAccess 2000, I have created a program with forms and applied some Conditional Formatting on some of the text box.
8
8515
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
3496
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...
1
4234
by: dddsssdddsss | last post by:
A comment and a question To anyone who is using conditional formatting, beware that in Access 2007 the color pallette is not the same as the color pallette in Access 2003. So if you have a particular color you were using as a standard throughout your application, the only way to continue using that color is to code the color. Anyone else notice how forms in Access 2007 display the conditional formatting much slower than in Access...
3
7502
by: Steve Antrobus | last post by:
Hello all, I've seen many discussions regarding continuous forms in Access and how to highlight individual rows and they all seem to suggest conditional formatting as the only way. This is fine, but I am struggling to understand if it will solve my problem. I have two subforms on a main form that contain many rows of data. What I want to do is highlight in subform 2 those rows that are not present in subform 1. I am using a query...
7
2096
by: Andy_Khosravi | last post by:
I use the formatting trick in A97 to simulate conditional formatting in continuous forms. It has, up to this point, worked fine. Today I was making some design changes to the parent form (the continuous form is a sub form within this parent form) when the formatting trick I was using stopped working. What's happening is that the character I use to 'block over' fields and make them appear to be invisible stopped displaying a solid bar...
1
2507
by: Earl Anderson | last post by:
A business colleague and I are collaborating 'long distance' on an applet for work. He is doing the programming and I am doing the business process form design. We had discussed my desire to make all of the textbox fields with the 'focus' become a 'light orange' in backcolor. He is working in A2k3/WinXP and I am working in A2002/WinXP (The users of the applet have A2k3). In our preliminary discussions about this particular enhancement,...
0
9699
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
10538
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...
1
10285
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
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
9115
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
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4270
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
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.