1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access 2007 Update Table Field from Form

Discussion in 'Business Applications' started by Cosla, Jul 14, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. Cosla

    Cosla Thread Starter

    Joined:
    Sep 6, 2007
    Messages:
    5
    I have created a database in Access 2007 with 4 tables, Customers, Products, Orders, and Order Details (the specific items for each order). I know you don't want to dupliate data and "calculated fields belong in reports and queries" but we change the prices frequently and I need the UnitPrice from the Product Database to "update" to the Order Details Table on the day the order is input.

    I have a Order Input Form with 2 sub-forms and my relationships are set one-to-many on primary keys. All other queries and forms work great. I have tried looking at the Northwinds database to determine how they do an "AfterUpdate" event procedure but I haven't used VBA since Access 97 and am not able to convert it for use with my form.

    Help is appreciated!
    :confused:
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
  3. Cosla

    Cosla Thread Starter

    Joined:
    Sep 6, 2007
    Messages:
    5
    Wow - what a lot of information to digest. It has taken me most of the day but I have been able to incorporate a lot of it into my database. Thank you.

    I have a questions: I used your VBA Code for the AfterUpdate feature on my Item Number record and it did pull up the price information from the other table correctly. The only problem is that it only updated the first order detail item. When I try to input a second item, it comes up blank. I'm sure I just missed some setting - any suggestions?.

    Thanks again for all your great help, you are definitely the Guru for this!
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Cosla, we have a real Microsoft Guru on the Forum now, I am not sure if he is staying or not but he is HiTechCoach.
    I have been to his website and it has some brilliant stuff.
    See http://www.hitechcoach.com/

    As to your problem, add a msgbox at the beginning of the VBA to ensure that it is running for the second Record, also of course nesure that the item does actually have a price.
    The message box format is simply
    msgbox "OK"
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/935561

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice