Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Bold if between two dates

Status
Not open for further replies.

EllieFant

MIS
May 15, 2001
513
US
I want to make the [Inspection #] (I know not to use the # in the name but this is an older database, am redoing it but need this report asap) bold if the Date_Complete field is null or the date doesn't fall between the two dates established on my BetweenDate Form.

I used the following between statement in my query, but not sure how to include it in the on format event of my report:

Between [Forms]![BetweenDates]![StartDate] And [Forms]![BetweenDates]![EndDate]

Here is the code I have in the On Format event of my report:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Date_Complete) Then
[Inspection #].FontBold = True
Else
[Inspection #].FontBold = False
End If
End Sub

It bolds the Inspection # if it is null, but I need to know if it would have been null between the two dates specified on my BetweenDates form.

Your help is much appreciated!


Ellie
**Using Access 97 at work**
**Using Access 2000 at home**

lena.wood@starband.net
 
Several ways to do this. Here's one:
[tt]
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Date_Complete) or _
not(Date_Complete >= Forms]![BetweenDates]![StartDate] And _
Date_Complete <= [Forms]![BetweenDates]![EndDate])
Then
[Inspection #].FontBold = True
Else
[Inspection #].FontBold = False
End If
End Sub
[/tt]




Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top