Hi Joanne,
Here is my script.vbs in my form template, hope it will be useful, and it
could query the main data connection(access database) by hand.
(Please replace
xmlns:my=""
http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-03-13T10:33:26""
with the namespace uri in your form template.)
' This file contains functions for data validation and form-level events.
' Because the functions are referenced in the form definition (.xsf) file,
' it is recommended that you do not modify the name of the function,
' or the name and number of arguments.
' The following line is created by Microsoft Office InfoPath to define the
prefixes
' for all the known namespaces in the main XML data file.
' Any modification to the form files made outside of InfoPath
' will not be automatically updated.
'<namespacesDefinition>
XDocument.DOM.setProperty "SelectionNamespaces",
"xmlns:q=""
http://schemas.microsoft.com/office/infopath/2003/ado/queryFields""
xmlns:d=""
http://schemas.microsoft.com/office/infopath/2003/ado/dataFields""
xmlns:dfs=""
http://schemas.microsoft.com/office/infopath/2003/dataFormSolution""
xmlns:my=""
http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-03-13T10:33:26"""
'</namespacesDefinition>
'=======
' The following function handler is created by Microsoft Office InfoPath.
' Do not modify the name of the function, or the name and number of
arguments.
'=======
Sub CTRL5_7_OnClick(eventObj)
' Write your code here
XDocument.UI.Alert(XDocument.QueryAdapter.Command)
dim oldCommand
oldCommand = XDocument.QueryAdapter.Command
XDocument.QueryAdapter.Command = XDocument.QueryAdapter.Command + " where
1 = 1"
XDocument.Query()
XDocument.QueryAdapter.Command = oldCommand
XDocument.UI.Alert("selected")
End Sub
InfoJet Service
InfoPath Web Form
[
http://www.infojetsoft.com]