This code is used to handle an empty recordset. If you have an empty or null recordset the recordset object does exist, but many recordset methods will cause runtime errors (e.g. .movefirst, .movenext, move previous, .movelast)
This line of code is checking and if the recordset is not null...