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 / August 2005

Tip: Looking for answers? Try searching our database.

code for Run Query button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric - 16 Aug 2005 06:40 GMT
Is there anywhere documented what the guts of what is running behind the Run
Query button?

What I want to do is set some flag when you press the Run Query button, but
the default button allows you nothing, other than to modify itself.

Any sites that explain it?
Thanks,
Eric
Scott L. Heim [MSFT] - 16 Aug 2005 14:17 GMT
Hi Eric,

You can reproduce what the Run Query button is doing by calling this code:

- VBScript:
    XDocument.Query

- JScript:
    XDocument.Query();

So if you change your button to use code, you can then set a flag, check a
condition, etc. before executing the query.

I don't know of any specific documentation/site stating the Run Query
button does "x" but you can see all the various methods, properties, etc.
available to you by doing these steps:

- Open an InfoPath form in Design View
- Display the Help Task Pane
- Click the Table of Contents link at the top
- Click the InfoPath Developers Reference at the bottom
- Click the InfoPath Object Model Reference

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Eric - 16 Aug 2005 17:01 GMT
Yes, that queries the data, but it also submits a new row to the database,
which is not what I want. Is there another command that I can use?
> Hi Eric,
>
[quoted text clipped - 26 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Scott L. Heim [MSFT] - 16 Aug 2005 17:25 GMT
Hi Eric,

That seems odd because if you were going to "submit" data you would instead
call: XDocument.Submit.

If you click the default Run Query button, does it submit or just query?
The code I provided should work identically - if it is not, can you
describe a repro test for me?

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Eric - 16 Aug 2005 21:20 GMT
I thought it was odd also, as I put it in the query, and as soon as I press
the modified Run Query button, it displayed below two records, I then looked
at the database and saw that there were two records

Let me try it again, and I will see if I can repo a demo and send it to you.
> Hi Eric,
>
[quoted text clipped - 11 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Eric - 16 Aug 2005 21:45 GMT
I just tested it again, and it does seem to be working as you had said,
thank you!

Eric
> Hi Eric,
>
[quoted text clipped - 11 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Scott L. Heim [MSFT] - 16 Aug 2005 22:01 GMT
Hi Eric,

That's great to hear!

Take care,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
 
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.