I was using the code below to display a text string on a form. It worked fine until the new year, now instead of getting the day of the year to appear in Julian format (today is "005") I'm getting "5Su".
example: on the form, txtJulDate displays"540105Su20". Should display "5401000520".
Any suggestions? Thanks.
Private Sub Form_Load()
Dim PN As String 'Plant Number "5401"
Dim YR As String 'last digit of the year
Dim JD As String 'julian day section
Dim DC As String ' single digit to represent the decade
Dim TD As String 'today's date and time
PN = "5401"
YR = "0"
JD = Left(Format(Now, "Yddd"), 3) 'used Left....3, because I'm not displaying the ''y" part
DC = "2"
On Error Resume Next 'on the form, "txtJulDate" is an UNBOUND textbox
'that displays the string, read-only
Me.txtJulDate = PN & YR + JD & DC & "0"
Me.txt270 = Date + 270
Me.txt360 = Date + 360
Me.txt480 = Date + 480
Me.txt560 = Date + 560
Me.txt720 = Date + 720
Me.txt730 = Date + 730
End Sub
example: on the form, txtJulDate displays"540105Su20". Should display "5401000520".
Any suggestions? Thanks.
Private Sub Form_Load()
Dim PN As String 'Plant Number "5401"
Dim YR As String 'last digit of the year
Dim JD As String 'julian day section
Dim DC As String ' single digit to represent the decade
Dim TD As String 'today's date and time
PN = "5401"
YR = "0"
JD = Left(Format(Now, "Yddd"), 3) 'used Left....3, because I'm not displaying the ''y" part
DC = "2"
On Error Resume Next 'on the form, "txtJulDate" is an UNBOUND textbox
'that displays the string, read-only
Me.txtJulDate = PN & YR + JD & DC & "0"
Me.txt270 = Date + 270
Me.txt360 = Date + 360
Me.txt480 = Date + 480
Me.txt560 = Date + 560
Me.txt720 = Date + 720
Me.txt730 = Date + 730
End Sub