Auto populating a date field

S

Sam

Hello

I have a drop down box Listed as " Status" This drop down box contains 6
different status's. I want to auto populate a field called "Date Of Status"
With the current date, each time the status is changed.

However there are two status named "N" and "RJ" where another date field
(called Date Approved/ Declined) is to be auto populated and not changed. I
was able to auto populate this field using =IIF([Status]="N",date(),
IIF([Status]="RJ",Date())), however when the status changes

Is this possible?
 
A

Allan Murphy

Sam

You could use a case statement using the Afterupdate event of the list box

Select Case Status

Case "N","RJ"
Me!Date of Status = Date()
Me!Date/Approved/Declined"= date()
case Else
Me!Date of Status = Date()
End Select

Note: I would change Date of Status field name to Date_of_Status or
DateofStatus as date is a reserved word and will cause problems. try using
field names as
one word.

HTH
 
S

Sam

Allen

Works Beautifully!

Is there a way of rolling back the date incase the user chooses the wrong
status????

Allan Murphy said:
Sam

You could use a case statement using the Afterupdate event of the list box

Select Case Status

Case "N","RJ"
Me!Date of Status = Date()
Me!Date/Approved/Declined"= date()
case Else
Me!Date of Status = Date()
End Select

Note: I would change Date of Status field name to Date_of_Status or
DateofStatus as date is a reserved word and will cause problems. try using
field names as
one word.

HTH
--
Allan Murphy
Email: [email protected]
Sam said:
Hello

I have a drop down box Listed as " Status" This drop down box contains 6
different status's. I want to auto populate a field called "Date Of Status"
With the current date, each time the status is changed.

However there are two status named "N" and "RJ" where another date field
(called Date Approved/ Declined) is to be auto populated and not changed. I
was able to auto populate this field using =IIF([Status]="N",date(),
IIF([Status]="RJ",Date())), however when the status changes

Is this possible?
 
Top