Thursday, February 14, 2019

Submit form data to a Microsoft Access database

Submit form data to a Microsoft Access database

In this article

Overview

Step 1: Enable the submit data connection

Step 2: Configure the submit options

Overview

When you design a Microsoft Office InfoPath form template that is based on a Microsoft Office Access (.mdb) or Microsoft Office Access 2007 (.accdb) database, the Data Connection Wizard creates a submit data connection to the database if the following conditions are met.

  • The form template is designed so that users must fill it out by using InfoPath. If the form will be filled out by using a Web browser, the form cannot submit data directly to a database. To configure a browser-compatible form template to submit data to a database, use a data connection that submits data to a Web service that works with the database.

  • The primary database table that is used in the main data connection contains a primary key, unique constraint, or unique index.

  • Any other database tables that are used with this main data connection possess a simple, hierarchical relationship to the primary database table.

  • The database does not contain fields that can store a large binary data type, such as pictures, images, OLE objects, file attachments, the Office Access memo data type, or the SQL Text data type.

If the database meets these requirements, InfoPath creates the submit data connection and adds a Submit button to the Standard toolbar and a Submit command to the File menu on the form.

Note: Secondary data connections cannot submit data to a database. If you want to use a submit data connection to a database as a secondary data connection, identify a Web service that works with the database, and then add a submit data connection to that Web service.

After you enable the submit data connection, you can customize the submit options for your form template in the following ways.

  • Change the text that appears on the Submit button on the Standard toolbar, and the Submit command on the File menu.

  • Change the keyboard shortcuts for the Submit button on the Standard toolbar, and the Submit command on the File menu.

  • Create custom messages to display to your users when they submit their forms.

  • Specify whether to leave the form open, close the form, or open another blank form after the form is submitted.

Top of Page

Step 1: Enable the submit data connection

  1. On the Tools menu, click Data Connections.

  2. In the Data Connections dialog box, click the main data connection, and then click Modify.

  3. In the Data Connection Wizard, click Next.

  4. On the next page of the wizard, select the Enable submit for this connection check box, and then click Finish.

Top of Page

Step 2: Configure the submit options

After you enable the submit data connection, InfoPath adds a Submit button to the Standard toolbar and a Submit command to the File menu. InfoPath also configures the forms that are based on this form template to display a message to users after they submit their completed forms. This message states whether the form was successfully submitted. By default, InfoPath also keeps the form open after a user submits it. To change the text that appears on the Submit button, as well as the behavior that occurs after users submit their forms, do the following:

  1. On the Tools menu, click Submit Options.

    1. To change the name of the Submit button that appears on the Standard toolbar and the Submit command that appears on the File menu when users fill out the form, type the new name in the Caption box in the Submit Options dialog box.

      Tip: If you want to assign a keyboard shortcut to this button and command, type an ampersand (&) before the character that you want to use as a keyboard shortcut. For example, to assign ALT+B as the keyboard shortcut for the Submit button and command, type Su&bmit.

  2. If you do not want people to use a Submit command or the Submit button on the Standard toolbar when they fill out your form, clear the Show the Submit menu item and the Submit toolbar button check box.

    1. By default, after users submit a form, InfoPath keeps the form open and displays a message to indicate if the form was successfully submitted. To change this default behavior, click Advanced, and then do one of the following:

      • To close the form or create a new blank form after the user submits a completed form, click the option that you want in the After submit list.

      • To create a custom message to indicate if the form was successfully submitted, select the Use custom messages check box, and then type your messages in the On success and On failure boxes.

        Tip: Use a message in the On failure box to tell users what to do if they cannot submit their form. For example, you can suggest that users save their form and contact someone for further instructions.

      • If you do not want to display a message after the user submits a form, clear the Show success and failure messages check box.

Top of Page

No comments:

Post a Comment