Subform with Mult-Selection

DBFIN

Registered User.
Local time
Today, 13:48
Joined
May 10, 2007
Messages
205
I have an "add" form that sends data to a table via combo boxes. I need a combo box that will allow user to select multiple states, which are then automatically stored in the table. The help resources state that selecting a multi-select property of simple or extended automatically converts a combo box to an unbound status. The recommended alternative is to create a sub-form.

Question 1: How do I create this subform so that it automatically stores a multiple selection in the table?

Question 2: How do I link the results of this subform into the add form.

Please offer any help with the assumption that I'm a beginner with this topic. Thanks in advance for your help.
 
DBFIN,

Checkout the attached database example. This is just to demonstrate the use of a form (single form view) and subform (continuous form view). This example shows a company in the main form, and the states where that company is present in the subform.

Look at the table relationships in the relationships view. The main form is bound to the company table while the subform is bound to the CompanyPresence table. Both tables contain a company ID field which acts as the link between the form and subform. Access will automatically enter the companyid in the subform to match that of the company currently being displayed in the main form when the record is created.

The combo box on the subform stores the StateID number (which is the primary key field of the States table) but it displays the State names.

In your application you will need to have an equivalent pairing of tables to enable you to store multiple states for whatever entity you are displaying in your main form. I would try to be more specific but you have told us almost nothing about your database (a relationships view and general description would help)
 

Attachments

Users who are viewing this thread

Back
Top Bottom