No, this works out perfect. I want the date to change each time someone
enters into it. However, I am getting a different date than the current
date. The date I am getting is 12/30/1899 for some reason. Do you have an
idea on what is causing this?
fredg said:
I have a form with a textbox that I need to input today's date each time
someone goes into the textbox. This textbox is tied to a date field in my
table. Can someone please give me suggestions on this.
Thanks.
Everytime someone enters the text box?
Code it's Enter event:
Me![ControlName] = Date
Of course, this value will change anytime someone tabs into or click
on the control, even days into the future. This doesn't seem logical.
Perhaps you mean something different. If so, give us a bit more
information.
Where did you place the expression?
On the control's property sheet's Enter event line, write:
[Event Procedure]
Then click on the little button with the 3 dots that appears on that
line.
When the code window opens, the cursor will be flashing between 2
already existing line of code.
Between thos lines writ:
Me![ControlName] = Date
Change [ControlName] to whatever the actual name of that control is
(which may, or may not, be the same as the table field that control
is bound to, i.e. use the Control Name, not the name shown in the
Control Source property).
Exit the code window.
Try it now.
If you still get that 1899 date, place a breakpoint on the code line,
Open the form and tab or click into the date field control.
When the code window appears, hover your cursor over the word Date.
Today's date should appear. Step into the next line. Hover your
cursor over [ControlName]. Today's data should appear. If not, post
back with the exact Enter code you are using and perhaps a bit more
information.