thanks for your answer
yes, i have the data connection to the library and i want do it in the way you wrote. in other words: give me the highest id than add 1.
after click button save the the document with the filename highest ID plus 1
do you think the error occurs because the id is changing when the form becomes submitted? (please excuse my english)