On Fri, 04 Feb 2005 21:49:49 -0500, RustyMoran <hm****@erols.com>
wrote:
Seems like something is incorrect in your database design. You are
saying the new location is added to tblBirdsObserved, but not to
tblLocations?
Proper relational db design would mandate this structure:
tblBirdsObserved with fields including LocationID
tblLocations with fields LocationID, LocationName, etc.
There would be an enforced referential integrity link between the two
tables, ensuring the first table can only have LocationID values that
occur in the Locations table. This would make your current behavior
impossible.
Then you design a 2-column combobox that pulls LocationID,
LocationName from the Locations table; LocationID is a 0-width column,
and is the bound column. The way I think about it is that a combobox
is an ideal tool to give the db what it wants (ID values) while giving
the humans what they want (Name values). The human thinks she is
selecting a name, while under the hood we are storing an ID value.
The combobox would be limit to list, and if you enter a location that
does not yet exist, the NotInList event fires. There you can write
code to add the new location to the table (perhaps using an Append
query), and have Access reload the combobox and try to find the value
again.
Happy programming.
-Tom.
I'm creating a data entry form for my primary table (birds observed)
and want to use a combo box that refers to a lookup table (locations).
I've set the combo box to except new locations (ones not in the
table). This populates the location field in the primary table okay,
but it does not add the new location to the lookup table. Is there a
way to make this happen automatically? Thanks in advance for any help.