Good day. I'm hoping to word this question properly. I'm building a form in Microsoft Infopath 2007 that links to an access 2007 database. What I want to do is when the user opens the form that:
A:It automatically displays the last 10, 20, however amount of records I decided to return from the access database without having to manually submit the query before the records are displayed
B:Users can only enter new data and cannot edit records sent back (make the returned records read only). Once they submit a record, they can't edit that record but can still see it.
Hope that makes sense. Thanks for any help.
To avoid misunderstanding, I will address your questions from question B to question A
Question B: To let the user can only enter new data:
1st, we need create a form template that is based on a Microsoft Access database.
Add the dataFiled to the form as a Repeating Table, right click on the table, and click Repeating Table Properties, clear the check box in front of "Allow users to insert and delete rows", and click OK.
Question A: To automatically displays the last 10, 20 records:
1st, we need to create a query in Access database with the following SQL sample:
SELECT TOP 10 Table.[ID], Table.[Name] FROM Table ORDER BY Table.[ID] DESC;
2nd, add the query as a secondary data connection. Make sure the "Automatically retrieve data when form is opened" check box is selected.
Add this dataField to the form as a Repeating Table.
(Optional) Right click on the Text Boxes in the table, and click Text Box Properties, click Display tab, select the check box in front of Read-only.
There you go.
Read more from the following documentation about how to make your InfoPath forms work well with Access:
- Design a form template that is based on a Microsoft Access database
- Add a data connection to a Microsoft Access database
- Submit form data to a Microsoft Access database
- Use values from an Access database to populate a list box, drop-down list box, or combo box
- Change the main data connection to another Microsoft Access database
And a few bonus articles, also from our friends in the documentation team:
TechNet Community Support