PDA

View Full Version : DateDiff() as field lookup



better
03-13-2006, 08:42 AM
Can anyone tell me how to use a Datediff function in a field lookup? I've managed to do this on a form, using this code:


Private Sub TimeOut_Exit(Cancel As Integer)
Me![Hours] = (DateDiff("n", Me![TimeIn], Me![TimeOut])) / 60
End Sub


Problem is this table will be being populated over the web via ASP.

Thanks in advance!

Bart

better
03-13-2006, 08:53 AM
Or perhaps I could assign the function as the field's default value? Tried it, but can't figure out what syntax to use to reference the TimeIn and TimeOut fields of the same record.