Since I just use MS Access 2003 to compact and repair a corrupted database, more errors were shown from it that weren't existed before the corruption. There are 2 errors I'm currently having:
3421 Data type conversion error
The error highlights the following code
WHERESQL is a string defined under [Option Explicit], it stores the date filter criteria with 2 input date variables.
3464 Data type mismatch in criteria expression
The error highlights this line of code
RptRS and QueryRS is the recordset, and both sides are integers.
The errors are from 3 forms, the forms only have 2 date selection (From and To) and a preview button to create a report output. The database I'm using is a split database, where the corrupted one stores the tables. So is it still possible the problems locate in the database that stores the queries, forms and reports? Or what should I do with the database that stores the tables to fix the "type" errors.
3421 Data type conversion error
The error highlights the following code
Code:
fmtFrom = "cdate('" & Format(fromDate, "dd-mmm-yyyy") & "')"
fmtTo = "cdate('" & Format(toDate, "dd-mmm-yyyy") & "')"
fmtDateRange = "cdate(format([date],'dd-mmm-yyyy'))>=" & _
fmtFrom & " And cdate(format([date],'dd-mmm-yyyy'))<= " & fmtTo
WHERESQL = WHERESQL & " AND " & _
fmtDateRange
mydb.Execute ("UPDATE Attendance SET ManfHours = IIF(isNull(ManfHours),0,ManfHours) , " & _
" WhouseHours = IIF(isNull(WhouseHours),0,WhouseHours) , " & _
" [Other Hrs] = IIF(isNull([Other Hrs]),0,[Other Hrs]) " & _
WHERESQL)
3464 Data type mismatch in criteria expression
The error highlights this line of code
Code:
RptRS.Fields(rptFieldIndex) = QueryRS.Fields(queryFieldIndex)
The errors are from 3 forms, the forms only have 2 date selection (From and To) and a preview button to create a report output. The database I'm using is a split database, where the corrupted one stores the tables. So is it still possible the problems locate in the database that stores the queries, forms and reports? Or what should I do with the database that stores the tables to fix the "type" errors.
Comment