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 / March 2006

Tip: Looking for answers? Try searching our database.

Retrieving textbox value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tammy.djuric@alemy.com.au - 03 Mar 2006 12:31 GMT
I've set up an Infopath form which uses a relational Access database as
the main datasource and an SQL Server database as the secondary
datasource.   I'm using the value of one textbox in the form to filter
information from the secondary database.  I've been able to get this
working in a dummy form which only has the secondary database using

var objEmpId;    
      objEmpId =
XDocument.DOM.selectSingleNode("//my:myFields/my:txtEmpId").text;

I've tried to get this working on my other form but can't get the value
from the texbox.  I've been testing using a message box but the closest
I can come is having the message box appear (I was getting errors
before I got to this stage) but it's blank.  I have another message box
which displays the SQL statement being passed to the database and the
field comes up as undefined.

The code I have is
      var objEmpId;    
     
      objEmpId =
XDocument.DOM.selectSingleNode("//dfs:myFields/dfs:dataFields/d:tbl_Employee/@UserCode").Text

Any help will be greatly appreciated!
S.Y.M. Wong-A-Ton - 03 Mar 2006 12:59 GMT
JScript is case-sensitive. Try .text instead of .Text

Correct code snippet:

objEmpId =
XDocument.DOM.selectSingleNode("//dfs:myFields/dfs:dataFields/d:tbl_Employee/@UserCode").text // <- correction!

---
S.Y.M. Wong-A-Ton

> I've set up an Infopath form which uses a relational Access database as
> the main datasource and an SQL Server database as the secondary
[quoted text clipped - 20 lines]
>
> Any help will be greatly appreciated!
Tammy - 05 Mar 2006 22:48 GMT
That did it!!  Thank you so much - I can't believe I spent so much time
on it and it was that simple!
 
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.