Results 1 to 3 of 3
  1. #1
    FormerJarHead is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    52

    Populating form controls with old data

    Hi all,

    I have a form with several controls. Among them are 3 in particular:

    Vendor Price - Unit cost with no tax


    Unit Price - Vendor Price w/tax
    Old Price

    What I am trying to accomplish is a way to track what previous costs were by having the Old Cost control populate with the Unit Price controls value when there is a change to either VP or UP either due to new cost or new tax rates.

    Possible?

    I found a bit of code online but was not able to get it to work for me...probably because I haven't a clue of how to structure it for my needs. Since I don't feel compelled to make myself look like a fool, I thought it best to go to the pro's...

    Any help will be greatly appreciated...

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Possible but can get complicated. How to prevent repetitive edits of the OldPrice field if the user corrects their entry in one edit session?

    Why is this needed? How is it useful to this database?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    alcapps is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    292
    I think you need to store the table entries in a new fashion..
    add a few fields to your table that holds price.
    creation date, startdate, stopdate
    now every time there is an update to the table save the entire record.

    example.
    record
    id, creation date, startdate, stopdate, VP, UP
    1 1/1/2013, 1/1/2013, blank, 20.00, 25.00

    later you update the table..
    id, creation date, startdate, stopdate, VP, UP
    1 1/1/2013, 1/1/2013, 1/5/2013, 20.00, 25.00
    1 1/5/2013, 1/1/2013, 1/6/2013, 21.00, 26.00
    1 1/6/2013, 1/1/2013, blank, 21.50, 26.50

    so you copy the entire record put in a stopdate for the original record.

    in your queries if you want the most recent record you add
    stopdate is null as criteria.

    if you want history of changes you remove the stopdate is null and order by creation date and you have all the history of changes..
    you will have to control the ID field. which can be done by reading the table and getting the last number and adding 1 to it when you create a new record.


    and you have an audit trail of every change..



    Quote Originally Posted by FormerJarHead View Post
    Hi all,

    I have a form with several controls. Among them are 3 in particular:

    Vendor Price - Unit cost with no tax
    Unit Price - Vendor Price w/tax
    Old Price

    What I am trying to accomplish is a way to track what previous costs were by having the Old Cost control populate with the Unit Price controls value when there is a change to either VP or UP either due to new cost or new tax rates.

    Possible?

    I found a bit of code online but was not able to get it to work for me...probably because I haven't a clue of how to structure it for my needs. Since I don't feel compelled to make myself look like a fool, I thought it best to go to the pro's...

    Any help will be greatly appreciated...

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

Similar Threads

  1. Replies: 4
    Last Post: 12-18-2011, 05:55 PM
  2. Data Populating
    By Zetony in forum Access
    Replies: 11
    Last Post: 11-02-2011, 12:20 PM
  3. Populating a form with table data!
    By Extracash in forum Forms
    Replies: 6
    Last Post: 09-13-2010, 05:47 AM
  4. Auto populating Form controls
    By eww in forum Forms
    Replies: 1
    Last Post: 08-09-2010, 12:49 PM
  5. Form data not populating in table
    By sabrown in forum Forms
    Replies: 0
    Last Post: 08-27-2009, 08:19 PM

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