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: 5,951
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.

--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
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: 5,951
Joined: 30-June 11



thumbup.gif My pleasure.

--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    25th June 2018 - 04:42 AM