If you simply mean document data that was entered (or is displayed) using a subform, then the COM, Lotusscript or Java interfaces can do it (forms and subforms are not germane to the question, just items and their content and flags, and the items will appear on the document regardless of access to the subform).
You probably have choices in between NotesSQL and the C API. Why don’t you explain more about what you’re trying to do, and where/how your code will be running?