Fixing dates

MartinO

Registered User.
Local time
Today, 14:55
Joined
Oct 8, 2002
Messages
22
I have a query looking at a table looking at several fields. Two of these fields are [Designer] and [Start Date]. Because I want to be able to calculate the length of time a designer takes on a particular job I need the start date to be fixed. Calculations can then be based on that date. However my 'customer' wants the date to be added to the Query automatically on entry of the designer name. I have put the formula iif([Designer]=true,Date())
in the start date field and it seems to work except that the date changes every day. How do I fix it permanently????

(The 'customer' wants to view in tabular form, hence the query, I've already tried to get him to use a form knowing that what I want works that way)
 
Use a continuous form which looks like the query, use the after update event of [Designer] to set the default value on the date field you require
 
I am going to assume that this information is part of a new record and is set because it is a new record. Therefore, if you set the default value of the [Start Date] field to Date() it will set the value to today's date only when it is a new record. As you have it now (depending on where you have the code), it is reset if there is a value in the designer field (which there will always be) so it pops in todays date (basically updates the field every time).

You can also do it all in code by doing something like this:

If me.newrecord then
me.Start_Date.value = Date()
end if

Hope this helps.

Paul
 

Users who are viewing this thread

Back
Top Bottom