T
Tony Nichols
Has anyone seen the Year() function create an error
indicating there is a data type mismatch?
Below is the a bit of code that works in one form but not
in another and is puzzling me
Dim sSQL As String
Dim db As Database
Dim rec As Recordset
Dim sECR As String
Dim nECR As Integer
Dim dYear As Integer
Dim sYear As String
Dim dDate As Date
Set db = CurrentDb()
dDate = Date
dYear = Year(dDate)
sYear = dYear
sYear = Mid(sYear, 3, 2)
The error number 13 (Type mismatch) occurs at the dYear =
Year(dDate) line.
Any assistance would be greatly appreciated.
Tony Nichols
indicating there is a data type mismatch?
Below is the a bit of code that works in one form but not
in another and is puzzling me
Dim sSQL As String
Dim db As Database
Dim rec As Recordset
Dim sECR As String
Dim nECR As Integer
Dim dYear As Integer
Dim sYear As String
Dim dDate As Date
Set db = CurrentDb()
dDate = Date
dYear = Year(dDate)
sYear = dYear
sYear = Mid(sYear, 3, 2)
The error number 13 (Type mismatch) occurs at the dYear =
Year(dDate) line.
Any assistance would be greatly appreciated.
Tony Nichols