我已经多次使用过这种类型的结构而没有问题,但这次我收到了“type incompatibility”错误消息(错误13)。 当我在查询设计器中运行它时,SQL语句返回结果。
Dim cSQL As String
Dim rsAlertes As Recordset
cSQL = "SELECT Detail.[DATE RECEPTION], Detail.FOURNISSEUR, Detail.[N° DE COMMANDE], Non_comformite.Nature_default " & _
"FROM Detail INNER JOIN Non_comformite ON Detail.[N° DE COMMANDE] = Non_comformite.PO " & _
"WHERE Detail.Alerte = True " & _
"ORDER BY Detail.[N° DE COMMANDE]"
Set rsAlertes = CurrentDb.OpenRecordset(cSQL) *** This is where I get the error
If rsAlertes.RecordCount = 0 Then
DoCmd.Close
End If
感谢您提供任何帮助或建议。