I am having some issue here, and I am not too sure how to handle it. If you could lead me in the right direction, that would be appreciated:
Private Function Convert2YearTo4Year(ByVal str_DTG2Year As String) As String
Dim str_sys4Year As String
Dim i_sys2Year As Integer
Dim i_sys2Century As Integer
str_sys4Year = Right(Str$(Of Date), 4)
i_sys2Year = Val(Right(str_sys4Year, 2)) 'value of system 2-digit yr
i_sys2Century = Val(Left(str_sys4Year, 2)) 'value of system 2-digit century
If Val(str_DTG2Year) < i_sys2Year And i_sys2Year - Val(str_DTG2Year) > 50 Then 'next century
Convert2YearTo4Year = Trim$(Str$(i_sys2Century + 1) + str_DTG2Year)
ElseIf Val(str_DTG2Year) > i_sys2Year And Val(str_DTG2Year) - i_sys2Year > 50 Then 'prev century
Convert2YearTo4Year = Trim$(Str$(i_sys2Century - 1) + str_DTG2Year)
Else
Convert2YearTo4Year = Trim$(Str$(i_sys2Century) + str_DTG2Year) 'current century
End If
End Function
The error in the title of this post is flagging at Right(Str$(Of Date), 4).
Remove
Of.Ofis used to pass generic type arguments.You should replace that whole line with
DateTime.Now.Year.