Forum Discussion
info from pulldown menu and store it in another table
You might like to take a look at DatabaseBasics.zip in my public databases folder at:
https://onedrive.live.com/?id=44CC60D7FEA42912%21169&cid=44CC60D7FEA42912
This little demo file the third form in the section on 'entering data via a form/subforms' includes a bound cboCustomer combo box whose RowSource is:
SELECT Contacts.ContactID, [LastName] & ", " & [FirstName] AS Customer,
Contacts.Address, Cities.City, Regions.Region, Countries.Country
FROM Countries INNER JOIN (Regions INNER JOIN (Cities INNER JOIN Contacts
ON Cities.CityID = Contacts.CityID) ON Regions.RegionID = Cities.RegionID)
ON Countries.CountryID = Regions.CountryID
ORDER BY Contacts.LastName, Contacts.FirstName;
Below this are four unbound controls whose ControlSource properties reference the Column property of the bound combo box to show the address data from the above query for the customer selected in the combo box.
By storing the address data only in the referenced tables, and showing it in unbound controls in the form there is no redundancy in the Orders table to which the form is bound, and the table is consequently normalized to at least Third Normal Form (3NF) which requires that all non-key columns be determined solely by the whole of the table's primary key.
Note, however, that in the items ordered subform, the unit price of each selected item is not referenced in this way, but the current value in the UnitPrice column is assigned to a UnitPrice column in the OrderDetails table to which the subform is bound. This does not introduce redundancy, because the price of items will change over time, but the price associated with each order must remain static as that current at the time the order was created.