T
TC
You clearly understand the normalization aspects of the situation. Your
first three tables are properly normalized, and you're asking how to create
a fourth one to support the users' denormalized view of the world.
I agree with the other poster that you should not store the denormalized
data - ie. stick with the 3 tables you have already. However, you could
generate the denormalized data "on the fly". For example, the following
code, if placed within the Form_Current event of a form that was based on
the facilities table, would populate the txtFacilities textbox with the list
of facility IDs for each Development:
(untested)
dim rs as recordset, s as string
set rs=dbengine(0)(0).openrecordset ( _
"SELECT FacilityID FROM DevelopmentFacility" & _
" WHERE DevelopmentID=""" & me![DevelopmentID] & """")
while not .eof
s = s & ", " & rs![FacilityID]
rs.movenext
wend
me![txtFacilityIDs] = mid$(s, 3)
Of course, if "kitchen" is a facility name or description (not the ID), you
would want to show the names, not the IDs - but you get the idea.
Then you would also have to trap any edits to the "list" field, and
*manually* parse & validate them (using appropriate VBA code) & update the
join table entries accordingly.
IOW, it's do-able, but quite a bit of fiddly work. It would be way easier if
you could convince the users to go to a subform approach (main form =
development, subform = facilities). Or maybe do *both*? Use the "list"
approach for display purposes only, but make them use a subform when they
added, edited or deleted facilities to/in/frm developments?
HTH,
TC
first three tables are properly normalized, and you're asking how to create
a fourth one to support the users' denormalized view of the world.
I agree with the other poster that you should not store the denormalized
data - ie. stick with the 3 tables you have already. However, you could
generate the denormalized data "on the fly". For example, the following
code, if placed within the Form_Current event of a form that was based on
the facilities table, would populate the txtFacilities textbox with the list
of facility IDs for each Development:
(untested)
dim rs as recordset, s as string
set rs=dbengine(0)(0).openrecordset ( _
"SELECT FacilityID FROM DevelopmentFacility" & _
" WHERE DevelopmentID=""" & me![DevelopmentID] & """")
while not .eof
s = s & ", " & rs![FacilityID]
rs.movenext
wend
me![txtFacilityIDs] = mid$(s, 3)
Of course, if "kitchen" is a facility name or description (not the ID), you
would want to show the names, not the IDs - but you get the idea.
Then you would also have to trap any edits to the "list" field, and
*manually* parse & validate them (using appropriate VBA code) & update the
join table entries accordingly.
IOW, it's do-able, but quite a bit of fiddly work. It would be way easier if
you could convince the users to go to a subform approach (main form =
development, subform = facilities). Or maybe do *both*? Use the "list"
approach for display purposes only, but make them use a subform when they
added, edited or deleted facilities to/in/frm developments?
HTH,
TC