Opening form pointing to a particular row in a database

E

Eric

Is there a way to open a form and to point to a particular row in a database
table?

I would imagine that it would be some type of command line argument like
'file.xsn id=123' where it opens up the main connection on the column called
ID, row number 123

Thanks,
Eric
 
S

Scott L. Heim [MSFT]

Hi Eric,

There is not a command line argument for this but you can achieve what you
need by using a Rule. Here are sample steps based on the Northwind
database, the Customers table and have this open to a specific customer ID:

- Create a new InfoPath solution based on the Customers table from Northwind
- Expand the queryFields and drag the CustomerID field to the query section
- Expand the dataFields, drag the Customers table to the data section and
choose Repeating Section with Controls
- From the Tools menu choose Form Options
- Select the Open and Save tab
- Click the Rules button
- Click Add
- Click Add Action
- From the Action box select: Set s field's value
- Click the button next to the Field box, expand queryFields, select the
CustomerID field and click OK
- In the Value field, enter: BERGS and click OK
- Click Add Action
- From the Action box select: Query using a data connection
- From the Data Connection box choose Main Connection and click OK
- Click OK 3 times to get back to your form
- Preview - you should automatically see the record for BERGS!

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

Eric

This would work if I was always wanting to open up a form to one specific
row.

What I am looking for is to do some work, and then after getting some data
from the database, to click a button open, send a particular key from the
form that I am working with right now, and send that key id=123 to a
seperate different form that opens up a different table where table2 id = id
from the other form.

I think I have figured it out, and have commented on it at:
http://partner2learn.com/wordpress/index.php

The only issues I have now is that this test I am running is against Access,
and I get a few security warnings, which I am looking into how to get rid
of.
 

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