Can anyone point me in the right direction with this.
I trying to add the suffix (st, nd, rd etc) to a date. but not getting the right result. Im trying to use Case to get the right suffix, if i just verify 1st, 2nd and 3rd of the month it works but obviously i need to also pick out 21st, 22nd,23rd and 31st. So this is what im trying but it doesnt get the 1, 2 and 3 it just goes straight to 'th'
Private Sub Report_Activate()
Dim SuffixNum As Integer
Dim SuffTemp As String
SuffixNum = Format(Me.[Datestop], "d")
MsgBox SuffixNum
Select Case SuffixNum
Case 1 Or 21 Or 31
SuffTemp = "st"
Case 2 Or 22
SuffTemp = "nd"
Case 3 Or 23
SuffTemp = "rd"
Case Else
SuffTemp = "th"
End Select
Me.[Text55] = SuffixNum & SuffTemp
End Sub
"Children are smarter than any of us. Know how I know that? I don't know one child with a full time job and children."...Bill Hicks
I trying to add the suffix (st, nd, rd etc) to a date. but not getting the right result. Im trying to use Case to get the right suffix, if i just verify 1st, 2nd and 3rd of the month it works but obviously i need to also pick out 21st, 22nd,23rd and 31st. So this is what im trying but it doesnt get the 1, 2 and 3 it just goes straight to 'th'
Private Sub Report_Activate()
Dim SuffixNum As Integer
Dim SuffTemp As String
SuffixNum = Format(Me.[Datestop], "d")
MsgBox SuffixNum
Select Case SuffixNum
Case 1 Or 21 Or 31
SuffTemp = "st"
Case 2 Or 22
SuffTemp = "nd"
Case 3 Or 23
SuffTemp = "rd"
Case Else
SuffTemp = "th"
End Select
Me.[Text55] = SuffixNum & SuffTemp
End Sub
"Children are smarter than any of us. Know how I know that? I don't know one child with a full time job and children."...Bill Hicks