Hi Mike,
Here are the steps I followed that appear to work:
- Created my sample from the Northwind Shippers table
- Added the "ShipperID" field from the "queryFields" to the Query section
- Added the Shippers table from the "dataFields" section to the Data section
- Added a Rule on the ShipperID "Query Field" that executes the query if
the ShipperID field "is not blank"
- In the OnLoad event of my form, I set the value of the ShipperID "Query
Field" using the following:
Sub XDocument_OnLoad(eventObj)
Dim nodeShipperID
Set nodeShipperID =
XDocument.DOM.selectSingleNode("//dfs:myFields/dfs:queryFields/q:Shippers/@S
hipperID")
nodeShipperID.Text = 3
End Sub
So now when I open this form, the ShipperID "Query Field" is populated with
a 3 and the form only displays that record. If I then modify the value, the
form requeries and displays the appropriate record.
I hope this helps! :-)
Best Regards,
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights
Patrick Temple - 03 Aug 2005 16:42 GMT
Scott,
I understand what you did there but you manually set the shipperID in the
code. How do I pass a value for shipperID to the form when I open it.
Example: I have a list of several requirements with unique values. I want
to make a hyperlink that will open the InfoPath form and pass the value of
that requirement to InfoPath. Then the form could query the database for the
information. This worked real slick in Sharepoint when we were using XMl
forms but when we converted to SQL database this functionality was lost.
--Patrick
> Hi Mike,
>
[quoted text clipped - 28 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights