G
Guest
Scenario:
Relational Database with following structure:
Tables: Residents
Resident Next of Kin
Resident Medical Details
Each of these tables has a [ResidentName] field. The [ResidentName] field in
the Residents Table is unique and has an associated ID (autonumber). The
relationship of the Residents table to the Resident Next of Kin and Resident
Medical Details tables is of ‘One’ to ‘Many’. The field [ResidentName] in the
Residents Table is the ‘One’ and the fields [ResidentName] in the Resident
Next of Kin and Resident Medical Details Tables are the ‘Many’ side of the
relationship (primary key to foreign keys).
Objective:
I have created Forms based on each of these tables. To speed things up I
configured the [ResidentName] fields in the Resident Next of Kin and Resident
Medical Details table as Lookup fields:
The Lookup Properties are as follows:
Display Control: Combo Box
Row Source Type: Table/Query
Row Source: SELECT tblResidents.ResidentName, tblResidents.FormerResident
FROM tblResidents WHERE (((tblResidents.FormerResident)=No)) ORDER BY
tblResidents.ResidentName;
This had the desired result where I can quickly select the name from a
drop-down list on the Form.
New Problem:
In a separate posting (Values with number and text 5/26/20005) Rick Brandt
replied to my query with these additional comments: “…if you have set your
current ValueList up in the Table design you should get rid of that. Lookup
tools like ComboBoxes belong in forms only, not in tables.â€
An aside Observation:
While I have read the ‘Evils of Lookup Fields in Tables’ I am not sure I
fully understand it. Illustrated examples associated with each of the points
made might help, particularly for access novices like me.
Revision:
To apply Rick Brandt’s advice I applied the following steps:
1.Opened the Table ‘Resident Next of Kin’ and in the Lookup property of the
‘ResidentName’ field reverted to Text box as the Display Control.
2.Created a new query, added the ‘Resident’ Table to the Design grid and
dragged the [ResidentName] field and the [FormerResident] (datatype: Yes/No)
field onto the field display grid.
3.In the ‘Resident Next of Kin’ Form I deleted the [ResidentName] field.
4.Executed the Combo Box Wizard:
- selected the query to provide the values for the combo box
- selected the Field [ResidentName] which contains the values
- selected to store the selected value of the [ResidentName] field in the
Resident Next of Kin Table.
Result: Successful.
Is this the correct procedure?
Relational Database with following structure:
Tables: Residents
Resident Next of Kin
Resident Medical Details
Each of these tables has a [ResidentName] field. The [ResidentName] field in
the Residents Table is unique and has an associated ID (autonumber). The
relationship of the Residents table to the Resident Next of Kin and Resident
Medical Details tables is of ‘One’ to ‘Many’. The field [ResidentName] in the
Residents Table is the ‘One’ and the fields [ResidentName] in the Resident
Next of Kin and Resident Medical Details Tables are the ‘Many’ side of the
relationship (primary key to foreign keys).
Objective:
I have created Forms based on each of these tables. To speed things up I
configured the [ResidentName] fields in the Resident Next of Kin and Resident
Medical Details table as Lookup fields:
The Lookup Properties are as follows:
Display Control: Combo Box
Row Source Type: Table/Query
Row Source: SELECT tblResidents.ResidentName, tblResidents.FormerResident
FROM tblResidents WHERE (((tblResidents.FormerResident)=No)) ORDER BY
tblResidents.ResidentName;
This had the desired result where I can quickly select the name from a
drop-down list on the Form.
New Problem:
In a separate posting (Values with number and text 5/26/20005) Rick Brandt
replied to my query with these additional comments: “…if you have set your
current ValueList up in the Table design you should get rid of that. Lookup
tools like ComboBoxes belong in forms only, not in tables.â€
An aside Observation:
While I have read the ‘Evils of Lookup Fields in Tables’ I am not sure I
fully understand it. Illustrated examples associated with each of the points
made might help, particularly for access novices like me.
Revision:
To apply Rick Brandt’s advice I applied the following steps:
1.Opened the Table ‘Resident Next of Kin’ and in the Lookup property of the
‘ResidentName’ field reverted to Text box as the Display Control.
2.Created a new query, added the ‘Resident’ Table to the Design grid and
dragged the [ResidentName] field and the [FormerResident] (datatype: Yes/No)
field onto the field display grid.
3.In the ‘Resident Next of Kin’ Form I deleted the [ResidentName] field.
4.Executed the Combo Box Wizard:
- selected the query to provide the values for the combo box
- selected the Field [ResidentName] which contains the values
- selected to store the selected value of the [ResidentName] field in the
Resident Next of Kin Table.
Result: Successful.
Is this the correct procedure?