DateAdd & DateDiff Problems

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to create a form as follows..

A Date is entered in a field (DateIn), Rune out time is displayed
automatically in a second field (DateOut) using the following expression

=DateAdd("d","20",[DateIn])

First problem.... the table does not recognise the field [DateIn] but will
happily work with Date() ie todays current date.

Now I want to display a third field (DaysRemain) between current date and
DateOut.

I'm trying to use DateDiff expression to do this but cannot get the function
to work correctly. Either the field displays an #Error or #Name?.

I assume (?) that its something to do with the structure of the DateDiff
statement or the format type of the DaysRemain field, which is currently set
to text although i have tried various others to no avail.

Any assistance would be most appreciated

Paul
 
Is DateIn the name of a field in the underlying recordset, is it the name of
a control on your form, or both? If both, rename the control (say, to
txtDateIn) to avoid any ambiguity.

Then, try =DateAdd("d", 20, Me.txtDateIn) as the control source for the
DateOut field.

=DateDiff("d", Date(), Me.DateOut) should then work.
 
Back
Top