You would most likely need to write code to achieve this. I can't think of anything in InfoPath (out of the box) to support this.
However, InfoPath forms based on SharePoint lists don't allow code, so that makes this even more difficult.
How about allowing users to enter a name? Is that a good enough workaround?