Results 1 to 6 of 6
  1. #1
    rgrwatson85 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    9

    Question Cascading Updates Help

    I'm trying to set up a customer/order database for a school project. This is a final project and it requires that I build a database, albeit a simple one, for a real company. So my issue is that the prices for their inventory may very well change from time to time and I do not want the price changes to reflect in the previous orders. I set the referential integrity between tblINVENTORY and tblORDERS_SUBFORM(the junction table between tblINVENTORY and tblORDERS) to not cascade updates, but it appears that changing the price for an item doesn't really apply to this situation. I will attach a test copy of my DB with two orders that I am trying to have different prices for. Look in the Add/Modify Orders form to see what I am talking about. I put what I am trying to do in the remarks section in that form. Thanks for any input guys/gals.



    Morgan

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    First off - you need to understand what Cascade Updates really means. This is normally not used because it ONLY means that if the PRIMARY KEY of one table changes (for those not using an autonumber), then the child records will automatically have their foreign key (the primary key in the parent table) updated to match. It has nothing do do with anything else.

    I can't look at your db right now because I only have 2003 here at work. But you would actually need to store the price in the table and to do that you would likely need to use code in the after update event of a combo box which selects the inventory item.

  3. #3
    rgrwatson85 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    9
    Ok, I look forward to hearing back from you. I have been working on this to no end, and I really want to get it right.

  4. #4
    rgrwatson85 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    9
    Well I think I may have figured it out. I added a Price field to tblORDERS_SUBFORM. I changed my ItemName lookup to also include the price in a second column. Then I used the code Me.Price = Me.ItemName.Column(1). Of course I had to change the controls used in calculating my subtotals, but that was a pretty easy fix.

    If you wouldn't mind still looking at the database when you get a chance it would be greatly appreciated, just in case I did something really dumb and didn't even realize it!

  5. #5
    rgrwatson85 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    9
    And I'm the king of speaking too soon. Totally doesn't work! I'll wait until I get another pair of eyes to help...

  6. #6
    rgrwatson85 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    9
    Well I was hoping for more of a response, but I guess I'm just SOL. I'll just mark it as solved since nobody can or will help me.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need a querie that updates.
    By imlost2 in forum Queries
    Replies: 1
    Last Post: 08-20-2011, 09:06 AM
  2. query updates
    By kwooten in forum Queries
    Replies: 1
    Last Post: 06-14-2011, 11:43 AM
  3. Ideas on shorter code for cascading updates
    By usmcgrunt in forum Programming
    Replies: 3
    Last Post: 12-03-2010, 12:17 PM
  4. Database Updates
    By avarusbrightfyre in forum Programming
    Replies: 1
    Last Post: 09-15-2010, 02:58 PM
  5. Version Updates
    By avarusbrightfyre in forum Access
    Replies: 1
    Last Post: 09-09-2010, 11:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums