Auto enter current time when in one field when "completed" is sele

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

Guest

How can I Auto enter current time into one field when "completed" is selected
from a different list box.

I am making a form that I want to have a "date finalized" automaticaly
entered when I move the status listbox to "completed". I would also like to
be able to lock that form from being edited. Is this possible and How?

Thanks,
 
How can I Auto enter current time into one field when "completed" is selected
from a different list box.

I am making a form that I want to have a "date finalized" automaticaly
entered when I move the status listbox to "completed". I would also like to
be able to lock that form from being edited. Is this possible and How?

Thanks,

See my answer in your other (subject-only) message for the first.

For the latter, you'll need to set the Form's AllowEdits property to
False in the AfterUpdate event of the combo box, if the value is
"Completed". You will *also* need to put code in the Form's Current
event to check the value of the status field, and set the form's
AllowEdits to True or False appropriately.

John W. Vinson[MVP]
 
Use the AfterUpdate event for the list box:

if me.MyList="Completed" then
me.MyTimeField = now()
end if

To lock the form use the Current event on the form:

if me.Mylist="Completed" then
if me.allowedits then
me.allowedits=false
end if
else
if not me.allowedits then ' unlocks the form when is not completed
status
me.allowedits=edit
end if
end if
<a href="www.joshdev.com">jl5000</a>
 
Thanks for the responce!
However, I am confused with your syntax. Admitedly I am not a programer.
The form name is "ID#" and the list box is named "Status". The Time box is
named "DateFinalized".

If willing, would you give me the syntax. I tried a few different ways but
I always get a syntax error.

Thanks,

MarcTA
 
Back
Top