I keep getting this error:
Run-time error '3464': Data type mismatch in criteria expression
I know this is a common error to get, but in my case none of the questions in the forum seems applicable.
This is my code, and I have checked several times that the field names are the same in Excel and Access. Could it be that one of my fields in the Access table is a check box? I'm using True/False as values in Excel for that field.
Private Sub cmdImportMaintJobs_Click()
xlsMaintFile = OpenFileDialog(CurrentProject.Path & "\", "*.xls?", "MS Excel sheet", "*.xls; *.xlsx", "Select Excel file with Maintenance Jobs data")
If Len(xlsMaintFile) > 0 Then
CurrentDb.Execute "INSERT INTO tblMaintJob SELECT * FROM [Maint Jobs$A1:I50000] IN '" & xlsMaintFile & _
"' [Excel 5.0;HDR=YES;IMEX=1] WHERE MoldID <> 0 "
MsgBox "All done!", vbInformation, "Information"
End If
End Sub
code blocks... :-) - ashleedawg