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 / December 2004

Tip: Looking for answers? Try searching our database.

Scripting Query Button actions and other goodies....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jdionne@idealconsulting.com - 07 Dec 2004 13:52 GMT
I changed the default action on the Run Query to Rules and Custom Code
and wrote code for the OnCLick event for the button.  I am able to
successfully run the query.  However I want to be able to tell if my
query found any rows or not.  Is there a property for query state?  If
the query returns empty no error is thrown.  Also, it seems that when
the query runs and does return a row, and the datafields get populated,
I have an onafterchange event registered to the control, however when
the event fires, the eventObj.Source.text object is empty.  Is it
correct to guess the XDocument dom is not complete when the query
returns and many objects and events are not accessable?

Has anyone messed with this?  Or know if this is the proper behavior?
Thanks in advance,
John
Greg Collins [InfoPath MVP] - 07 Dec 2004 20:37 GMT
You can know if there were any rows returned by checking the number of rows in the repeating node of the data fields DOM. If there is a count of zero, there were no rows returned from the query. The number of rows in the repeating node is the number of rows returned from the query.

Signature

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

I changed the default action on the Run Query to Rules and Custom Code
and wrote code for the OnCLick event for the button.  I am able to
successfully run the query.  However I want to be able to tell if my
query found any rows or not.  Is there a property for query state?  If
the query returns empty no error is thrown.  Also, it seems that when
the query runs and does return a row, and the datafields get populated,
I have an onafterchange event registered to the control, however when
the event fires, the eventObj.Source.text object is empty.  Is it
correct to guess the XDocument dom is not complete when the query
returns and many objects and events are not accessable?

Has anyone messed with this?  Or know if this is the proper behavior?
Thanks in advance,
John
 
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.