Results 1 to 3 of 3
  1. #1
    zipaway is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    53

    VBA - Change date but keep history in another table

    Hello I'm having a lot of trouble figuring this out.

    I have two tables:

    Events
    Event_ID
    Event_Description
    Day_Number (An event can span over multiple days)
    Date

    Change_In_Date
    Change_Number
    Event_ID
    Day_Number
    Current_Date
    New_Date



    I want to be able to have a form table such as the one below, where I can see all the planned days for an event with their current date and I would just enter the new date and hit a button and the Events table would be updated.

    Click image for larger version. 

Name:	Capture.PNG 
Views:	9 
Size:	5.3 KB 
ID:	17413

    Recap
    • Have form with above table showing all Event Dates for a particular event
    • Form would pick up the 'Current_Date' from the Events table and apply it to the Change_In_Date table when new change is created
    • Once new dates are inputted a button is pressed and the new dates are applied to the Event table


    Please give me some direction on how to do this, or if there is a better way to do this.

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    The Change_In_Date table won't (or shouldn't) have any records for an event where dates have not been changed. My suggestion would be to have a form based on the Events table instead of the Change_In_Date table. You could then add a record to the Change_In_Date table (using VBA) whenever a date is changed - the after update event of the Date field (you should rename that field - calling it "date" could cause problems) in Events would work. You can use the oldValue property to determine what the previous value was.

    You could use another form to show you all the date changes for particular event.

    HTH

    John

  3. #3
    zipaway is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    53
    Quote Originally Posted by John_G View Post
    The Change_In_Date table won't (or shouldn't) have any records for an event where dates have not been changed. My suggestion would be to have a form based on the Events table instead of the Change_In_Date table. You could then add a record to the Change_In_Date table (using VBA) whenever a date is changed - the after update event of the Date field (you should rename that field - calling it "date" could cause problems) in Events would work. You can use the oldValue property to determine what the previous value was.

    You could use another form to show you all the date changes for particular event.

    HTH

    John
    This makes sense but it wouldn't work for my purposes, I would like to be able to review the change in date prior to hitting a button and updating the Events table with the new dates for each day_number. Any ideas?

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

Similar Threads

  1. Replies: 4
    Last Post: 03-15-2014, 08:47 PM
  2. Column history - date and time stamp
    By Hatye in forum Access
    Replies: 5
    Last Post: 11-15-2013, 01:26 PM
  3. Replies: 1
    Last Post: 02-05-2013, 12:15 PM
  4. History Table
    By Opid in forum Access
    Replies: 2
    Last Post: 05-07-2012, 10:50 AM
  5. Replies: 3
    Last Post: 02-01-2011, 07:15 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