date format in the text box

G

Guest

Hi,
I want to formt a textbox (txtDate) in "dd.mm-yyyy" and set a default value
as Now().
Everything seems to be working apart of storing a defualt value as. When I
click the txtDate the format changes and shows me date in a long format
16/01/06 2:01:47 PM
but I would like to see it just as (in the edit mode)
16/01/06

I guess I should apply some date/text function on fce Now(), but I do not
know which one

thansk in advance
 
A

Al Camp

Supicek,
Try using Date() as the default for txtDate instead of Now().
Now() produces Date and Time... Date() produces just the Date
 
W

Wayne Morgan

Yes, when you click in the textbox, you'll see the entire value you've
entered, not just the part the format will let you see. Now() is date AND
time. If you want just the date, use the Date() function. Storing the time
also when you don't intend to can have undesired consequences if you don't
compensate for it. For example, if you try to see if one date is before
another date and they are both the same date, but the time component is
different, you'll get a response that one is less than the other instead of
them being equal.
 
G

Guest

Set the default to date() insead of now(), now includes the current time,
when Date() will return the current date only, nd that what you want.
 
G

Guest

thanks works perfectly now.
:)

Ofer said:
Set the default to date() insead of now(), now includes the current time,
when Date() will return the current date only, nd that what you want.
 

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