Need help with code to update a Date field please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • terbolee
    New Member
    • Jan 2007
    • 23

    #1

    Need help with code to update a Date field please

    I have two fields: [NoDays] & [InvDate]. An integer, such as 14 for [NoDays] and dd/mm/yyyy for [InvDate]. A third date field, also dd/mm/yyyy for [EndDate] needs to be filled in with [InvDate] plus the [NoDays].

    I tried After update Event:

    Me.EndDate = Me.InvDate + Me.NoDays

    It does not work. Can you steer me in the right direction? Thankx.
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by terbolee
    I have two fields: [NoDays] & [InvDate]. An integer, such as 14 for [NoDays] and dd/mm/yyyy for [InvDate]. A third date field, also dd/mm/yyyy for [EndDate] needs to be filled in with [InvDate] plus the [NoDays].

    I tried After update Event:

    Me.EndDate = Me.InvDate + Me.NoDays

    It does not work. Can you steer me in the right direction? Thankx.
    The only reason I can think of, assuming both Fields are populated, is that
    [InvDate] and [EndDate], or either one, are defined as Text and not Date/Time in the underlying Table.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      Originally posted by terbolee
      I have two fields: [NoDays] & [InvDate]. An integer, such as 14 for [NoDays] and dd/mm/yyyy for [InvDate]. A third date field, also dd/mm/yyyy for [EndDate] needs to be filled in with [InvDate] plus the [NoDays].

      I tried After update Event:

      Me.EndDate = Me.InvDate + Me.NoDays

      It does not work. Can you steer me in the right direction? Thankx.
      Try designing a query based on the underlying table which includes a field ([InvDate] + 14) and see what it returns.

      Comment

      Working...