Results 1 to 2 of 2
  1. #1
    gstylianou is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2013
    Posts
    167

    Update values on Table1 depending the dates

    Hello to all friends,



    I need the help of the most experienced on Vba.

    What i need:


    • I have the attached database which includes 2 tables (Table1 and Table2) which are related One-2-Many (Table1 is the One and Table2 the Many)
    • There is one form also with the name "Form1" which includes 11 unbound (ctr1,2,3...11) and are calculated with the values of fields [MainDate] , [Days] and [EndDays]


    The Issue:

    As you can see in the attached sample, on Table1 i can assign the "MainDate" value , the "Days" and on field "EndDays" i can have the value of the [MainDate]+[Days].

    I need to update the field "RefNo" on Table1 on depending the date range of the field [EndDays] and the controls [ctr1-11]. Specifically i need : If the Date() is in the range of eg. [EndDate] and [ctr1] i need to have the value of the first record of the Table2 (RefNo) on field "RefNo" into Table1. If the Date() is the range of [EndDate] and [ctr2] i need the second record values of the field [RefNo] into Table2 and so over..
    Attached Files Attached Files

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Till someone comes along,
    A few queries :
    1) By Date(), are you indicating Todays Date
    2) End Date = Main Date + Days & ctr1 = Main Date + Days. So will End Date will always be same as ctr1.
    3) Why is End Date (calculated) stored in Table1 ?
    4) Why do you need to store RefNo (derived) in Table1 ?
    5) What is the need for the 11 ctrs on the Form ?

    Perhaps what you need can be achieved in a query.

    Thanks

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

Similar Threads

  1. Replies: 5
    Last Post: 07-29-2014, 11:20 AM
  2. Update table2 from table1- Runtime error
    By albasel in forum Programming
    Replies: 11
    Last Post: 02-19-2014, 10:13 AM
  3. Copy values from table1 to table2
    By wubbit in forum Queries
    Replies: 2
    Last Post: 04-19-2012, 04:40 PM
  4. Replies: 5
    Last Post: 08-20-2010, 06:40 AM
  5. Use Table1 to update Table2? Urg Help needed
    By munkifisht in forum Queries
    Replies: 1
    Last Post: 07-24-2009, 08:00 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