Script error

E

Eric

I have created about 5 infopath forms, all with the same script code in the
Load event:

Sub XDocument_OnLoad(eventObj)
dim Shell
dim env

set shell = createobject("wscript.shell")
set env = shell.Environment("process")

ab = env("username")

XDocument.DOM.selectSingleNode("//my:txtUser").text = ab

End Sub

ab holds the username of the user opening the form.
this works, but then it goes wrong.
On form number 6 this code stops at the last line where field txtUser is set
to the value from ab.

If I leave this event out completely, the form errors on the next line where
I use the Xdocument.DOM.SelectSingleNode method.

How is this possible. it works in all the other forms, the fields are
existing.

pls. help, I'm really stuck.
rg,
Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top