Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / November 2005

Tip: Looking for answers? Try searching our database.

Updating textbox text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Lee - 23 Sep 2005 21:46 GMT
I have a dropdown list in a repeating table using a secondary data source for
the list,  I want to update a textbox in the same row with the value of the
selection in the list box.  How do I do this?
Jay W - 23 Sep 2005 22:04 GMT
You can do this by setting a rule on the drop down list.
Open the properties for the drop down list.
The data tab should be selected.
Click Rules
Click Add.  You can give the rule a descripting name (Rule1 is the default)
Click Add Action.
Select Set a Fields Value
Use the Field chooser button to select the text box.
Use the Value button to reference the value returned by the drop down (this
should just be '.')
Click OK four times.

Now when you select an item in the list, the underlying value of that list
item will appear in the text box.

HTH,

Jay

> I have a dropdown list in a repeating table using a secondary data source for
> the list,  I want to update a textbox in the same row with the value of the
> selection in the list box.  How do I do this?
Mike Lee - 23 Sep 2005 22:22 GMT
Idid this but the only value that the text box will display is the value of
the first item in the dropdown list

> You can do this by setting a rule on the drop down list.
> Open the properties for the drop down list.
[quoted text clipped - 18 lines]
> > the list,  I want to update a textbox in the same row with the value of the
> > selection in the list box.  How do I do this?
Franck Dauché - 23 Sep 2005 22:07 GMT
Hi Mike,

You can do it by code.  If your textbox is named: field1, you need to use:
IXMLDOMNode oNode1  = e.Source.selectSingleNode("my:field1") to target the
correct textbox in a repeating section.
If your drop-down is field2 (IXMLDOMNode oNode2  =
e.Source.selectSingleNode("my:field2") )
then, field1.text = field2.text;
Your code can be placed on the OnAfterChange event of your field2.

Again, the trick is to use e.Source.selectSingleNode("my:field") instead of:
e.XDocument.DOM.selectSingleNode("//my:.../my:field").

Hope that it helps.

Franck Dauché

> I have a dropdown list in a repeating table using a secondary data source for
> the list,  I want to update a textbox in the same row with the value of the
> selection in the list box.  How do I do this?
muriel - 22 Nov 2005 10:14 GMT
I hav the same problem. I have used  the rules but it does not change
anything. The repeating text box are always fill in function of the first
listbox value.
Also I test your code but how do you get the result value of a formula?
I mean if the text box must display a fields in function of the choosed
value in the drop down list?

Thanks

> Hi Mike,
>
[quoted text clipped - 16 lines]
> > the list,  I want to update a textbox in the same row with the value of the
> > selection in the list box.  How do I do this?
Greg Collins [InfoPath MVP] - 28 Nov 2005 20:13 GMT
If you want to update a value of a different field on the same row, in code you would select "../my:fieldX" (note the ".."--that tells the selection to go to the up to row node, and then select the fieldX child.

Using rules, you just use the field picker and it should automatically select the other field on the same row.

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

I hav the same problem. I have used  the rules but it does not change
anything. The repeating text box are always fill in function of the first
listbox value.
Also I test your code but how do you get the result value of a formula?
I mean if the text box must display a fields in function of the choosed
value in the drop down list?

Thanks

"Franck Dauch" wrote:

> Hi Mike,
>
[quoted text clipped - 18 lines]
> > the list,  I want to update a textbox in the same row with the value of the
> > selection in the list box.  How do I do this?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.