Auto populating a date field

G

Guest

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
 
G

Guest

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: (e-mail address removed)
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top