Re: Getting Date Only



"CyndyG" <CyndyG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:111DD283-05BF-44A5-9562-0C7DC01766CB@xxxxxxxxxxxxx
> I can not get the date to appear in a field automatically after a
> certain event occurs. Here is the code:
>
> AfterUpdate for strRequestStatus Field
> If Me.strRequestStatus = "Closed" Then
> dteDatedClosed = Date
> End If
>
> I have tried on lost focus,
> I have tried using Date(), have tried setiing the date to short
> date,or formatting to mm/dd/yyyy.
> At one point I clicked in the field the date showed up,but went away
> when I saved the form.
>
> This is the same code I used in another database using Now() instead
> with no problem.

This is in the AfterUpdate event for the control named
"strRequestStatus"?

Do you have a control or public variable named "Date"? That could be
confusing Access and VBA.

Have you set a breakpoint and stepped through the code to see that it
executes the statements you think it does? If it fails the test in the
If statement, check the value of strRequestStatus to make sure that it's
really what you think it is.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.