Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / October 2008

Tip: Looking for answers? Try searching our database.

Cascade Update/Delete Lookup in Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joshua - 27 Oct 2008 22:58 GMT
Hello,

I'm trying to see if it is possible to have a table with a look up field
that updates all records when the linked table data is changed.

For example, we have categories in a separate table that is looked up in the
master table. If I change "graphic" to "graphics" and there are already rows
with "graphic," is there a way to make it update all those rows?

Thanks!
Jeff Boyce - 28 Oct 2008 00:26 GMT
Joshua

If you'll scan this newsgroup for related postings, you'll see that there is
considerable opinion against using "lookup" datatypes in tables.  While well
intentioned, the lookup datatype is actually storing one thing (the key
value), while displaying something else.

You'll also find considerable opinion against working directly in the
tables.  Access tables store data, but have little in the way of tools for
display.  Access forms display data and have a very rich "event" environment
you can use to make the data much more user-friendly.

I urge you to change that lookup datatype to whatever the underlying key
field's datatype might be, and to start using forms instead of the tables to
display data.

Regards

Jeff Boyce
Microsoft Office/Access MVP

> Hello,
>
[quoted text clipped - 8 lines]
>
> Thanks!
boblarson - 28 Oct 2008 00:31 GMT
Joshua:

You really shouldn't be storing text data from a lookup.  You should store
the ID number for the appropriate record as then you only need to make a
single change to an item in the lookup table if the text needs changing.  
Storing the ID number of the lookup is the way you keep normalization and
also then don't need to update multiple rows for a change in text.

As for Cascading Updates - if we talk about that from a relationship
standpoint, it has nothing to do with updating the text of the item in the
table.  It has to do with the fact that if you were to change the primary key
of an item in the table where it is the primary key, the foreign keys would
cascade update to match the new key.  But, if you use autonumbers for keys
(which is actually a pretty good idea), you would not ever likely need a
cascade update to occur.  A cascade delete is something that, if you set it,
will delete any child records for a parent record if the parent record is
deleted.  That way you do not have "orphan records" that hang around
afterwards.

I hope that makes sense.
Signature

Bob Larson
Access MVP
Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________

> Hello,
>
[quoted text clipped - 6 lines]
>
> Thanks!
boblarson - 28 Oct 2008 00:48 GMT
I just read Jeff Boyce's response and it had not occurred to me that you
might be talking about using lookups at the table level instead of at form
level (where I was talking about).  If you are talking about lookups at table
level, I would suggest reading this:
http://www.mvps.org/access/lookupfields.htm

Signature

Bob Larson
Access MVP
Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________

> Joshua:
>
[quoted text clipped - 27 lines]
> >
> > Thanks!
Daniel Pineault - 28 Oct 2008 00:31 GMT
If you have proper relationships between your tables you would only need to
make a change in the lookup table and they would instantaneously be 'pushed'
to your data table.  The key is your relationships.

Another alternative would be to use an update query.
Signature

Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.

> Hello,
>
[quoted text clipped - 6 lines]
>
> Thanks!
boblarson - 28 Oct 2008 00:46 GMT
Daniel:

Actually, that is not completely true, as noted by my earlier post.  Updates
to text values in a lookup table are NOT propagated to tables that have those
values stored.  And, those values should NOT be stored actually.  In reality
numeric ID's should be used as then you can update the text descriptions in
one place and, if you've used queries properly in your row sources, etc., it
will then display the updated text descriptions.
Signature

Bob Larson
Access MVP
Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________

> If you have proper relationships between your tables you would only need to
> make a change in the lookup table and they would instantaneously be 'pushed'
[quoted text clipped - 12 lines]
> >
> > Thanks!
boblarson - 28 Oct 2008 00:49 GMT
Daniel:

Actually, after reading Jeff's post I realize that you may have been on that
same track so forgive the other post.
Signature

Bob Larson
Access MVP
Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________

> Daniel:
>
[quoted text clipped - 21 lines]
> > >
> > > Thanks!
Daniel Pineault - 29 Oct 2008 17:12 GMT
Nothing to worry about, we are all here to help and learn!
Signature

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.

> Daniel:
>
[quoted text clipped - 26 lines]
> > > >
> > > > Thanks!
Jeff Boyce - 29 Oct 2008 17:55 GMT
AMEN!

Jeff B.

> Nothing to worry about, we are all here to help and learn!
>
[quoted text clipped - 39 lines]
>> > > >
>> > > > Thanks!
Joshua - 28 Oct 2008 15:23 GMT
First off, thanks for all the replies. You guys in this group help me more
than you all know.

I personally love forms. But my boss likes working in tables. Unfortunately,
for this situation we need to store the value that's being looked up. It's a
simplistic database though with 2 tables and one split form (07) so I won't
stress out about it. I'll just create a button that they can update that
category table and have it do an update query to match the parent table. More
trouble than I hoped for, but, it'll work.

Thanks again for all the wisdom.

> Hello,
>
[quoted text clipped - 6 lines]
>
> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.