Calculating datediff using vba code w/ 2 consecutive rows

What did you think of this Datediff using diff fields in two consecutive rows post?

  • Something new and helpful.

    Votes: 0 0.0%
  • Interesting issue.

    Votes: 0 0.0%
  • Old and redundant issue.

    Votes: 0 0.0%

  • Total voters
    1
  • Poll closed .

accessuser343

New member
Local time
Today, 09:55
Joined
Dec 26, 2011
Messages
2
Hi, here is what I am trying to do:
Using Access 2000, 2007 and 2010, I am trying to calculate the datediff, "n" between two different fields in two consecutive rows and put the value in a separate field in the first row using a vba function or module in Access.
Here is pseudo code:
If ([table1].[(row+1) field2]) = ([table1].[this row field2])
Then [This row Field5]=Datediff("n",[this row field 4],[next row field 3])
basically Format((Datediff("n",[Start time],[StopTimeNextRow])), "h:nn")
But how do I read in the next row using vb code?
What would the function or module be coded from start to finish?
Thank you in advance for any help...
 
Thank you for the quick reply! Researching it now...
 

Users who are viewing this thread

Back
Top Bottom