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

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Replace A Specific Date With Text In A Report, Access 2013    
 
   
snsd
post Feb 2 2018, 02:08 PM
Post#1



Posts: 495
Joined: 23-November 04
From: Markham, Ontario, Canada


In the SharePoint list that is being used for my report, I have a field called Due Date. When the due date cannot be specified, I enter January 1, 2001. In my report, I want to replace the date January 1, 2001 with the word "Various". This is the code I have put in the "On Current" event.
CODE
Private Sub Report_Current()
If Me.[Due Date] = "1/1/2001" Then
Me.[Due Date] = "Various"
End If
End Sub

Please advise what I'm doing wrong as it is displaying the date January 1.

Thanks in advance for any assistance.

Dave
Go to the top of the page
 
DanielPineault
post Feb 2 2018, 02:31 PM
Post#2


UtterAccess VIP
Posts: 6,274
Joined: 30-June 11



Why not do this in your report's Record Source?

You can use a simple IIF() to check and act accordingly. Something along the lines of

IIF([Due Date] = #1/1/2001#, "Various", [Due Date])

You could also do the same directly in the report on that specific control's Control Source.
Go to the top of the page
 
snsd
post Feb 2 2018, 02:42 PM
Post#3



Posts: 495
Joined: 23-November 04
From: Markham, Ontario, Canada


Thanks Daniel. Works perfectly. Sincerely appreciated.

Dave


Go to the top of the page
 
DanielPineault
post Feb 2 2018, 05:20 PM
Post#4


UtterAccess VIP
Posts: 6,274
Joined: 30-June 11



thumbup.gif My pleasure.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    15th December 2018 - 07:42 AM