Passing parameter from one form to another

C

Cresta

Hello
I have an Infopath 2007 form which populates a long list, each list item has
a button on the same row. When the button is pressed a "Details" form opens
with greater detail about the selected item. (This is my objective)
Each item has an ID which i need to pass to the "Details" form for it to
open the correct record.
How do I pass the ID to the next form?
All dataconections are to a SQL database.

Thanks
 
P

Paresh

Hello
I have an Infopath 2007 form which populates a long list, each list item has
a button on the same row. When the button is pressed a "Details" form opens
with greater detail about the selected item. (This is my objective)
Each item has an ID which i need to pass to the "Details" form for it to
open the correct record.
How do I pass the ID to the next form?
All dataconections are to a SQL database.

Thanks

Hi,

You can pass query parameters to the InfoPath.
For further information, please take a look at the following links:
http://blogs.msdn.com/infopath/archive/2007/02/26/passing-data-into-a-form-input-parameters.aspx
http://msdn.microsoft.com/en-us/library/ms772417.aspx
http://www.dotnetmafia.com/blogs/do...ing-parameter-to-an-infopath-data-source.aspx


Thanks,
Paresh
http://www.openzeas.com/blogs/Paresh
 
C

Cresta

I'm new to all this .netty stuff, please be patient.
I've looked at the links you have identified, but they confuse me more. So i
have taken a step back to try something simple!

I am now trying to get a value from a textbox to display on a messagebox
using the following code.
----
Dim thisDoc As New XmlDocument
Dim Nav As XPathNavigator
Dim Ele As String
Nav = thisDoc.CreateNavigator
Ele = thisDoc.OwnerDocument("CTRL868").Value.ToString
System.Windows.Forms.MessageBox.Show(Ele)
----
I get the following error:
----
System.NullReferenceException
Object reference not set to an instance of an object.
at Harry3.FormCode.CTRL874_7_Clicked(Object sender, ClickedEventArgs e)
at
Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
 
E

Ed Thurber

Cresta:

don't know if you are still working on this. my recommendation is to create
a view in the "main" form to display the detail. this way you dont have to
worry about passing data between forms. all you need to do is set an
element to the selected line item position and switch views. on the detail
view, have a repeating group and use conditional formatting to hide all but
the seleceted node. I have done this many times.

hope this helps.

Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top