Switch form and assign it to a parent document

I am designing a database and I need to be able to import an email message from the inbox into the database and assign it to as a child to a parent. I know that i can switch the form to a form in the correct database, but I do not know how to assign it to the appropriate parent.

An example, a person gets an email from a customer and needs to have it in the other database under that customers document.

I know that I can switch the form so that it is created inside the database that it needs to be moved to, but how do I create it as a child of that customers document?

Any help would be greatly appreciated!

Subject: switch form and assign it to a parent document

using lotuscript, you can lookup the customers document using whatever key that will retrieve that for you. That will give you a handle on the notesdocument (parentdoc) for the parent. You should already have a handle on the notesdocument that you are copying from your email (lets call it maildoc). So you then can make maildoc a response to parentdoc:

Call maildoc.MakeResponse( parentdoc )

Call maildoc.save(True,False)