Thanks very much for the replies. The problem, however, is that the SRnum field is guaranteed not to be null or an empty string. I get the Invalid Use of Null error when the EOF is reached. For some reason it's not recognizing that the EOF is reached and it tries to obtain the SRnum field again and assign it to the variable. How is this happening? Previously posting: Can someone please look at my code and tell me what I'm doing wrong, I keep getting an Invalid Use of Null error. I'm new to VBA so please forgive me. Basically I have 2 recordsets of 2 different tables. I'm trying to see if any records in rstHD are duplicated in rstSM, if so then delete the record from rstHD. rstHD.MoveFirst Do Until rstHD.EOF rstSM.MoveFirst srNumHD = rstHD![srNum] Do Until rstSM.EOF srNumSM = rstSM![srNum] If srNumHD = srNumSM Then rstHD.Delete Exit Do Else rstSM.MoveNext End If Loop rstHD.MoveNext Loop rstHD.Close rstSM.Close Set rstHD = Nothing Set rstSM = Nothing If I add a check for null before assigning srNumSM = rstSM![srNum] like so: Do Until rstSM.EOF If IsNull(rstSM![SRnum]) Then Exit Do End If srNumSM = rstSM![SRnum] And then it works but it doesn't successfully find the duplicates and delete the duplicate row. Any help would be greatly appreciated.