z.******@gmail.com wrote:
Smashed it - that works!! Nice one cheers for that.
I dont suppose you would know a way to insert the current date
automatically in the Date field?
There's many ways to do that. Here's two simple ways of doing that.
They only affect new records.
I open a table in design mode with a field called DF. In the
DefaultValue row I entered
Now()
Any record created will use that default value which can be overwritten
In the control's property sheet of the form you could enter
=Now()
in the DefaultValue property.
If you don't want the time, use Date().
Here's a code way, in the OnCurrent event of a form.
If IsNull(Me.DateFieldName) then Me.DateFieldName = Now()
This will affect both new and existing records.
IF you do use Now() just one caveat. Let's say you want records between
Date1 and Date2.
Where Date Between Date1 and Date2
For some reason you don't get any records for date2. Why? Because
using Date(), the time is midnight. So any records for Date2 with a
time not midnight will not be included. So you need to add a day to
date 2.
Where Date Between Date1 and Date2 + 1
This is only used if the date field is a date with time field.
Ahora Es
http://www.youtube.com/watch?v=3p1P4oYbmbU