View Single Post
  #5  
Old March 23rd, 2010, 11:12 PM posted to microsoft.public.access.forms
JOSELUIS via AccessMonster.com
external usenet poster
 
Posts: 26
Default Calculated a field in a subform.

OK I refuse to go on I change colon by semicolons, english into spanish NZ to
Nz or NzDate() and nothing ever happens so I´ve decided to stop working on
this I need a holidays maybe I´ll go to St James´way and I hope to get
enough strength to go on with this.
Up to then God Bless you.

John W. Vinson wrote:
Oh my God! I´ve tried everything but it doesn´t work.Firstly I put IIF in the
calculated control TotalDays but it didn´t calculate the total number of

[quoted text clipped - 12 lines]
End If
End Function


I'm not sure why you're having all the problems, but if there are textboxes
named DateIn and DateOut (not DatOut!!!) on your form, you should be able to
just use a control source of

=DateDiff("d", [DateIn], NZ([DateOut], Date())

This assumes that DateIn will always have a date; if it might be null,

=IIF(IsNull([DateIn], Null, DateDiff("d", [DateIn], NZ([DateOut], Date()))

Note Date() - the function - rather than [Date], which would refer to a field
or control.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201003/1