I suspect the error message is occurring because you're using an Excel data source and it has 'used' rows below the last data row. You could probably prevent the error by inserting:
If Trim(.DataFields("FieldName")) = "" Then Exit For
after:
.ActiveRecord = i
where 'FieldName' is the name of any field in the data source that should never be empty.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|