forms - Integrate junction and lookup tables with a basic Access database -
i have simple database stores customer's name, city , state. i've added 2 new tables. 1 lookup table, describing car model, , second junction table setting 1 or more car models customer record.
here's relationship layout of now:
and datasheets each table. cust_id
, model_id
auto increment columns.
demographics
lookup_model
junction_model
using scripting language, mysql , html whip complete form in few minutes. having little trouble figuring out how done in access 2007.
two features need are
- ability edit/add items lookup table
- ability add new customer records including selecting cars found in lookup table, while maintaining primary key relationships.
ex:
"mary jane" owns ford pinto , datson 510. when add info to-be-created form, cust_id 5, , 2 new entries show in junction table cust_id: 2 (ford) , 5 (datsun).
is there relatively painless way of setting form in access 2007?
edit: i've managed working far. subform lists correct model/cust associations, looking show combo box model_desc shown (not model id).
a form containing "subform" serve in case this.
you can create form named "owners" bound [demographics] table in can add/edit owner information (name, address, ...).
you can create "continuous forms" form named "cars_owned_subform" bound [junction_model] table. form contain combo box row source [lookup_model] table, displaying [model_desc] , returning [model_id].
then can add subform control "owners" table using subform wizard , link subform parent based on [cust_id]. move 1 owner next cars automatically update in subform, , if add new car in subform automatically associated [cust_id] of owner record being displayed.
as editing lookup table, create simple form edit [lookup_model] table.
edit re: question update
to have combo box displays [model_desc] , returns [model_id] you'll want have combo box "display" 2 columns first column has width of zero. is, format properties of combo box should include values like...
column count: 2
column widths: 0";1.3646"
...and data properties should include values like...
row source: lookup_model
bound column: 1
the final result this:
the subform in design view be:
Comments
Post a Comment