Creating a subform microsoft access




















The Subform Wizard is often smart enough to recognize the field and use it to link the two forms. If not, you will have to click the Define my own option and select the two related fields.

Subforms created with the Subform Wizard are usually a little rough around the edges and may require a little clean-up work.

Toggle navigation. Free Access Training. Click and drag where you want the subform to appear. However, if you place a copy of the accdb in Dropbox or a public OneDrive folder, you could make it available that way. Based on the initial description of the problem, you need three tables for this part of the database--plus whatever other tables are required to track all of the elements you need to track.

Duane already specified them for you, so this is a repetition and slight expansion. It needs a Primary Key, which would most likely be the AutoNumber datatype. It also needs a Primary Key, which would most likely be the AutoNumber datatype. This table has at least two fields, and probably several others. You will also, no doubt, need fields in the Drop table for DateDelivered, QuantityDropped, and anything else pertinent to each Drop. You know what you might need here.

Now, you can enter as many leaflets as you want for each customer in the Drop table, and as many Customers as you want in the Drop table. Just make sure you include both Foreign Keys in each Drop record. The way this is usually put into an interface--well, the most appropriate method--is to use a main form bound to one of the two source tables, either leaflets or customers, whichever is primary in your marketing scheme.

When you click Next , assuming that you set up the relationships correctly before you started the wizard, the wizard asks How do you want to view your data? Select the table on the "one" side of the one-to-many relationship. For this example, to create the Employees form, we will click by Employees. The wizard displays a small diagram of a form. The page should resemble the following illustration:. Note: If the wizard does not ask How do you want to view your data?

The wizard will continue, but Access will not add a subform to the form. You might want to click Cancel and examine your table relationships before you continue. At the bottom of the wizard page, select Form with subform s , and then click Next. On the What layout would you like for your subform? Both layout styles arrange the subform data in rows and columns, but a tabular layout is more customizable.

You can add color, graphics, and other formatting elements to a tabular subform, whereas a datasheet is more compact, like the datasheet view of a table. On the next page of the wizard, select a formatting style for the form, and then click Next. If you chose Tabular on the previous page, the formatting style you choose will also be applied to the subform. On the last page of the wizard, type the titles that you want for the forms.

Access names the forms based on the titles that you type, and labels the subform based on the title that you type for the subform. Specify whether you want to open the form in Form view, so that you can view or enter information, or in Design view, so that you can modify its design, and then click Finish. Access creates two forms — one for the main form that contains the subform control, and one for the subform itself.

Use this procedure to add one or more subforms to an existing form. For each subform, you can choose to have Access create a new form or use an existing form as the subform. Right-click the existing form in the Navigation Pane, and then click Design View. On the Design tab, in the Controls group, click the down-arrow to display the Controls gallery, and ensure that Use Control Wizards is selected.

When you click Finish , Access adds a subform control to your form. If you chose to have Access create a new form for the subform instead of using an existing form, Access creates the new form object and adds it to the Navigation Pane.

Use this procedure if you want to use an existing form as a main form, and you want to add one or more existing forms to that form as subforms. In the Navigation Pane, right-click the form that you want to use as the main form, and then click Layout View. Access adds a subform control to the main form and binds the control to the form that you dragged from the Navigation Pane. Access also tries to link the subform to the main form, based on the relationships that have been defined in your database.

To verify that the linking was successful, on the Home tab, in the Views group, click View , click Form View , and then use the main form's record selector to advance through several records. If the subform filters itself correctly for each employee, then the procedure is complete.

Extend the Form for the order list. Select the Orders table and click Next. The Subform Wiz will show the two tables as related via one field, i. Customer Id. Click Next.

Change the view to Layout View. The result shows all the orders for each customer. Conclusion As we see, it is effortless to create subforms in MS Access. Question or Message. Supriti Tripathy, OpenGrowth Content Team A believer of good things and pursuer of diverse avocation, she is a fiction lover and a simple writer. Read more articles written by the author.

Read More in Technology of Business Category. Post Your Comment. Post Comment. Women Entrepreneurs. Food Industry. Fashion Industry. Sign up for the latest newsletter.



0コメント

  • 1000 / 1000