Just some background... The purpose of my form is to act as a problem report that can be passed around to different people in my company. I have a feedback section where someone can add feedback to the form before moving it onto the next person.
With our current outlook form, we've had problems with people modifying feedback that they've inserted before... this is a problem and causes alot of arguments.
I've created a button in Infopath that pulls the username and time/date and attaches it to the feedback. If the username field is populated, the feedback becomes read only. I'm quite proud of this implimentation and it will work brilliantly... BUT I'm having problems getting the username to populate correctly.
In order to get the username in, I'm using C# (it's the only way.) Below is my code:
IXMLDOMNode nodeName =
thisXDocument.DOM.selectSingleNode("/my:SHPR/my:Feedback_option/my:Feedback/my:Feedback_repeat/my:Name");
nodeName.text = System.Environment.UserName; thisXDocument.DOM.selectSingleNode("/my:SHPR/my:Feedback_option/my:Feedback/my:Feedback_repeat/my:Timestamp").text = System.DateTime.Now.ToLocalTime().ToString();
So what it's doing is pulling the username and putting it into the repeating feedback table into the name field. The same with the date and time.
I type in the feedback, click the button and it works. But if I add another feedback field (because it's a repeating table) only the first field changes. I can't get the first field to lock and have the button apply to the subsequent fields.
If further information is needed, I can supply screenshots to better describe what's happening.