return the day

G

Guest

How do I type in the date i.e. 5/10/2005 in one field and in the other field
have it autofill the day Tuesday. I looked at other post and found this
Format (date(),"dddd")
I tried entering this in the format section of the second box and it didn't
work. 1 more questions it suggested to go to online help under format
function - where is this?

Thanks in advanced!
Zenis
 
R

Rick B

In a new UNBOUND TEXT field, enter...

=Format ([?????],"dddd")


Replace ????? with the prompt or field name that represents your entered
date.

In your original post, your formula (if entered in the right spot) would
have simply returned the day for the CURRENT date, not the entered date.

Note that this is put in an UNBOUND field because you would not store this
in your table. That would be redundant since you are already storing the
DATE and can pull out the day in your queries, forms, or reports using an
unbound field as demonstrated in the first paragraph above.
 
A

Alex White MCDBA MCSE

use the on change event of the box you are typing into to set the day of
week

e.g.

within the event

me.txtDayOfWeek.value = format(now(),"dddd")
 
G

Guest

The problem may be that there is nothing to format. The format function can
format a value, but it can't create one. If the first text box is txtDate1
and the second txtDayOfWeek, you could put this into the After Update event
of txtDate1:
Me.txtDayOfWeek = Format(Me.txtDate1,"dddd")
You could put the code in any number of other places, so explain the
specific circumstances if you need another approach.
Remember that txtDayOfWeek is unbound.
 

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