Results 1 to 4 of 4
  1. #1
    Fadhl is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2013
    Posts
    2

    Updated Fields in a table

    I have an access table with multiple fields that get updated every now and then. I would like to have a table in the same database that contain the records with specific fields that were updated within a specified date range.
    my table gets its data from a sql-based program automatically. this table contains product information: PLU, DESCRIPTION,PRICE, DATE MODIFIED. The table I am trying to have is one that would only have rows of items whose price was changed within a specified date. I would imagine that it is possible to have such a table that would receive these updated records every time any of their field are changed, I just don't have the knowledge to structure and design such a table BUT I am sure that this forum would have plenty of great minds capable of doing such a task. Please help

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    How is the SQL program updating specified records in table - by code in the SQL program or in Access?

    Maybe this will help http://allenbrowne.com/appaudit.html
    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
    Fadhl is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2013
    Posts
    2
    My actual database is in SQL. When I change for example a price of an item I do it manually in SQL by selecting an item from the inventory manager of the SQL-based program and then I simply put the new price and click ok to apply the change.
    What I really want is to be able to have a table in access linked to the SQL table containing the inventory items.
    I made a table in access and linked it the SQL table and it does automatically pick up all the changes as they occur in SQL. The SQL table has among its field one called modified date which stores the date and time of the change to that record regardless of the type of change that took place. In other words, if an inventory item is sold, SQL records that as a change since that item (record) did in fact experience a change which was a sale and the same happens when the price is reduced or increased for that item.
    I was wondering if it is possible to have a query in access or any other procedure in access to monitor only the changes in the PRICE field of a an item record and store the new value automatically in a separate table in the same access database. One idea is to have the linked table always make a copy of itself that is but not linked to SQL and then have a procedure to compare the new values of the PRICE field of this copy table to the newly updated fields in the linked table. I don't know how to do this But would appreciate your help.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Yes, I expect could be done. Table in Access would also store the change date. You want a history of all prices saved in the Access table? Compare latest change date in Access table for each product with the change date in SQL table and if they don't match then a change took place and save records to Access. I expect this can be done with a sequence of queries or totally by VBA.

    First query would be an aggregate (GROUP BY) that would show the Max change date for each product in the Access table:
    SELECT ProductID, Max(ChangeDate) AS MaxDate FROM tablename GROUP BY ProductID;

    Use that query in a find unmatched query - there is a wizard for that query.

    Records in SQL table that don't match the Access table can be data source for INSERT query. Google: Access query append unmatched.
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-08-2012, 12:04 PM
  2. Replies: 3
    Last Post: 08-01-2012, 05:47 PM
  3. Replies: 1
    Last Post: 02-27-2012, 10:41 AM
  4. Replies: 11
    Last Post: 09-15-2011, 03:52 PM
  5. Force form not to save updated fields
    By Evgeny in forum Programming
    Replies: 2
    Last Post: 04-30-2010, 10:44 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