Hi Tom and welcome to our forum!
You can add a data connection which queries the document library on load if it is the first time opening. To do this without writing code add a boolean node to your main data source called "IsNew". Use that node in the condition for the open rule. To define an open rule, go to Tools->Form Options->Advanced (InfoPath 2003). You can add another rule that copies the values from the SharePoint list/document library into the main data source so that you can show it after the form was opened the second time. You should be able to do this without any code since the doc library view should be "connectable" just like a regular SharePoint list, but I haven't done this recently. Anyway, good luck!
Patrick Halstead
Project Manager at Qdabra