UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Bolding New Information    
 
   
Janene_P
post Oct 25 2004, 01:32 PM
Post #1

UtterAccess Veteran
Posts: 311
From: PA



In a report that I print out each time additional information is added to it, I would like for the new information to be bolded. Is this possible? Thanks for the help!
Go to the top of the page
 
+
dannyseager
post Oct 25 2004, 01:41 PM
Post #2

UtterAccess VIP
Posts: 13,031
From: Leicester, UK



one way would be to add a number field to the table that the data comes from...

Then when the report is printed it also runs an update query to update the field for all the records in the table to 1.

That way you can identify which records are new.
Go to the top of the page
 
+
MrDriftwood
post Oct 25 2004, 01:56 PM
Post #3

UtterAccess Enthusiast
Posts: 82



An alternate method might be to change the BackColor of the detail section based on some formula. For example:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.txtInfo = 18 Then
Me.Detail.BackColor = 12632256 ‘grey
Else
Me.Detail.BackColor = 16777215 ‘white
End If
End Sub
Go to the top of the page
 
+
dannyseager
post Oct 26 2004, 04:12 AM
Post #4

UtterAccess VIP
Posts: 13,031
From: Leicester, UK



Mr Driftwood,

I don't understand how that would work out if it's a new record or not.
Go to the top of the page
 
+
MrDriftwood
post Oct 26 2004, 10:14 AM
Post #5

UtterAccess Enthusiast
Posts: 82



You would have to have some way of determining if the record is new. It looks like you are looking for records added since the last run of the report? If so you would need to add a “date created” field to your table (and populate it with the date the record was created) and then when your report is run, grey only those records added after some “Baseline Date” – this could be the last run of the report or any other date. This baseline Date will be used to determine what records to color grey.

One way to do this if you are not running your report from a form, is to pass the “baseline date” (all records created after this date are considered new) in query results. For example you would build a parameter query similar to this (my example uses a table called tblNames):

PARAMETERS [Enter Baseline Date:] DateTime;
SELECT tblNames.CreateDate, [Enter Baseline Date:] AS BaselineDate
FROM tblNames;

When run, this query prompts you for a baseline date. Make this query the record source for your report. Then in the On Format section of the Detail section add this code to compare the Created Date against the Baseline date and change the BackColor of the section if the Created Date is greater than or equal to the Baseline date:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.CreateDate >= Me.BaselineDate Then
Me.Detail.BackColor = 12632256 'grey
Else
Me.Detail.BackColor = 16777215 'white
End If
End Sub

When you run your report, the user is prompted to enter a baseline date. Once entered, the report checks each detail line’s Create Date against the Baseline date. If the Create Date is greater than or equal to the Baseline, it turns the Backcolor grey. If the Create Date is less than the Baseline, it turns the BackColor white.
Go to the top of the page
 
+
MrDriftwood
post Oct 26 2004, 10:17 AM
Post #6

UtterAccess Enthusiast
Posts: 82



Danny: My original example was only to show how to grey a detail section. It didn’t deal with determining if a record is new.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 23rd May 2013 - 09:40 AM