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

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Format Backcolor Using Text Field Ok - Date Field ?    
 
   
IanStow
post Aug 9 2011, 10:33 AM
Post #1

UtterAccess Veteran
Posts: 318
From: London UK



Hi guys

Can someone help me please. If I want to Change the Color format of a text field on a report I would do the following

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.DriverName = "Tom Symonds" Then
Me.DriverName.BackColor = QBColor(8)
Else
Me.DriverName.BackColor = QBColor(10)
End If
End Sub


But if it is a date field

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Driver_End_Date = ???????? Then (Can someone please tell me what to put here if date field is null)
Me.Driver_End_Date.BackColor = QBColor(8)
Else
Me.Driver_End_Date.BackColor = QBColor(10)
End If
End Sub


Many Thanks

Ian
Go to the top of the page
 
+
Jeff B.
post Aug 9 2011, 01:24 PM
Post #2

UtterAccess VIP
Posts: 8,170
From: Pacific NorthWet



First, just as you used quotes (") as delimiters around your text value, you'll need to use the correct delimiters around your date/time value (use the pound sign - '#').

I'm not sure I understand what you want to have happen if there is no date (you mentioned a Null)...
Go to the top of the page
 
+
IanStow
post Aug 10 2011, 03:38 AM
Post #3

UtterAccess Veteran
Posts: 318
From: London UK



My apologies for not explaining myself very well

I have a field on a report called Driver_End_Date (Date Format) which will either be empty or have a date in it
If I want to test to see if its empty and then change the Backcolor of another field called DriverName can someone show me
how to write the IF statement

Also can you change Multiple fields

ie DriverName , LicenseAuthority , DriverType etc

Appreciated

Ian

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 - 12:02 AM