Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inheriting field accross forms

Status
Not open for further replies.

awodi

Programmer
Jul 13, 2004
8
GB
Hello all,
I have a form that has fields that I want their values to also be in another form. Is it possible? Pls, help.

 
It is possible at creation of new document.
If you need to update existing docs with that value, you need to code it yourself.
Several methods are possible. You can code an agent that runs periodically out of office hours and checks all docs. Or you can code in the QueryClose event of a doc and check what docs are affiliated and what needs updating. You can also add code in the QueryOpen that checks if the doc has values that need updating.
In all cases, however, you will need to define a reference document - one that your code will determine as being the source of all updates. As long as that one does not change, no updates should be required on the others (at least, not after the others are up to date).
The rest of the documents will have to be linked to that reference doc, and you'll probably have to devise such links for all groups of source/dependant docs you have.
It is indispensable to have a unique identifier for each doc, so as to guarantee that the link will remain 100% valid. In all such cases I have been confronted with, I have found that the UniqueID of the source doc is the best reference. Copy its ID to all dependant documents and you have an instant rule : if the doc's ID is equal to the refID, then that doc is source.
As a plus, Notes can instantly find a doc in a db with the UniqueID, whereas any other key will need to be looked up in a view - which can waste time. In order to find all dependant docs, a simple view of docs classed by RefID wil do - make a collection and you know what docs need to be updated almost instantly.
It will require a fair bit of coding, and a bit of trial and error.

Good luck.

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top