Apr 19, 2007 #1 MrsNic Instructor Joined Feb 6, 2005 Messages 44 Location GB I want to compare a date with today's date and if the month is greater to put a Yes in a text box, if not no. I have tried the Iff function and DateDiff but I don't seem to be getting the syntax correct. Any help gratefully received. Cath
I want to compare a date with today's date and if the month is greater to put a Yes in a text box, if not no. I have tried the Iff function and DateDiff but I don't seem to be getting the syntax correct. Any help gratefully received. Cath
Apr 19, 2007 #2 RuralGuy Technical User Joined Jun 27, 2002 Messages 446 Location US Where are you doing the comparing? In a query? In event code in a form? Does the year make any difference? HTH RuralGuy (RG for short) acXP winXP Pro Please respond to this forum so all may benefit Upvote 0 Downvote
Where are you doing the comparing? In a query? In event code in a form? Does the year make any difference? HTH RuralGuy (RG for short) acXP winXP Pro Please respond to this forum so all may benefit
Apr 19, 2007 #3 nickdel Programmer Joined May 11, 2006 Messages 367 Location GB try this: Code: IIf(CDate(Me.Text1.Value) = Date, "True", "False") Cheers Nick Upvote 0 Downvote
Apr 19, 2007 #4 nickdel Programmer Joined May 11, 2006 Messages 367 Location GB I should maybe expand slightly on my example!!: Code: Dim CheckIt CheckIt = IIf(CDate(Me.Text1.Value) = Date, "True", "False") Me.Text2.Value = CheckIt Cheers Nick Upvote 0 Downvote
I should maybe expand slightly on my example!!: Code: Dim CheckIt CheckIt = IIf(CDate(Me.Text1.Value) = Date, "True", "False") Me.Text2.Value = CheckIt Cheers Nick
Apr 19, 2007 #5 TheAceMan1 Programmer Joined Sep 23, 2003 Messages 11,174 Location US How are ya MrsNic . . . Perhaps this: Code: [blue]= IIf(Month(CDate(Me.Text1.Value)) > Month(Date), "True", "False")[/blue] See Ya! . . . . . . Upvote 0 Downvote
How are ya MrsNic . . . Perhaps this: Code: [blue]= IIf(Month(CDate(Me.Text1.Value)) > Month(Date), "True", "False")[/blue] See Ya! . . . . . .