Many thanks Peter, that looks very much like what I need. I’ll just go and try it out.
I imagine I will have to do something else to pull the Ids out of the DBRef or will that just happen?