Full Version: Highlight records on a continious subform
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
Shane
To highlight particular records on a continuous subform, I use a method where by the data source of a small text box is based on a function. The function is passed the current record ID or other record value and returns a string value of "" or ">". Thus for the records where the function is true the record has a '>' character highlighting it. This works very well for small continuous forms however when there are lots of records (1000's) on the form it has to calculate the function for each record and this is taking some time.

What I am looking for is a way to only highlight certain records that are visible on my form without time delays with long continuous forms. The highlighting will be based on a number of values contained in the record.

As an example of what I currently do. Imagine I have a continuous form with one field, [MyDate], being a date. I could place a text box (transparent background and border, Red font colour) to the left of the date and set its control source to =RecentDate([MyDate]) The function RecentDate may be as follows

CODE

Function RecentDate(MyDate as Date) as String
if MyDate > Date()-30 then
   RecentDate = ">"
Else
   RecentDate = ""
EndIf
end function


This should highlight any record where MyDate is within the last 30 days.

Thank you for your help

Shane
freakazeud
Hi,
if you are using Acc2000 or higher then have a look at conditional formatting which you find under the format menu options in form design view.
If not then check these:
01
02
03
Or search UA for more threads on the old school method of applying conditional formatting.
HTH
Good luck
Shane
Thank you for your help, Unfortunately all these solutions apply the formatting to all the records in the continuous form and because of the time it takes to calculate wither to highlight a record or not I only want to format the 10 records that can be seen in the continuous subform at any one time.

If there any way I can pass my function the current record and have it quickly work out if it is within 10 records of this?

Thank you again

Shane
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.