datasheet: looping through records in a datasheet

  • Thread starter Thread starter Chris Large
  • Start date Start date
C

Chris Large

Hi

Put an unbound control on your form and set its control
source to

=Round(DateDiff("n",[SignIn],[SignOut])/60,2)

of course this won't store the value in a table, but then
I'm guessing you are storing SignIn and SignOut so you
don't need to store the difference as you can calculate it
easily when required.

hth

Chris

-----Original Message-----
Hi guys:

I have created a function that calculates sign in/ sign
out times for a datashee. It works for the record level
when a user updates or tabs from the signout field.
code:
TimeTotal = Round(DateDiff("n", Me.SignIn, Me.SignOut) / 60, 2)

Now I am requested to set all the signout fields in a
group of records (where the parent / child relationship
exists)
So, question is how do I reuse my code, something that
would loop through the records for that datasheet and
execute this function on each.
Something like this

for each record in subform

TimeTotal = Round(DateDiff("n", subformrecord.SignIn,
subformrecord.SignOut) / 60, 2)
 
Back
Top