PC Review


Reply
Thread Tools Rate Thread

autofill day of week field when entering date in date field

 
 
=?Utf-8?B?Q2h1Y2sgV2lsbGV5?=
Guest
Posts: n/a
 
      10th Jun 2005

When the user enters a date in a date field, I need to have the day of the
week autofill in a separate text box.

I'm stumped, please help...




 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9ueQ==?=
Guest
Posts: n/a
 
      10th Jun 2005
Try using the lost focus function to populate the other filed when the user
leaves the date filed with the same data that is in the filed the user enters
the date in but change the format of the new field to dddd for day of the
week.

-Tony

"Chuck Willey" wrote:

>
> When the user enters a date in a date field, I need to have the day of the
> week autofill in a separate text box.
>
> I'm stumped, please help...
>
>
>
>

 
Reply With Quote
 
Marshall Barton
Guest
Posts: n/a
 
      10th Jun 2005
Chuck Willey wrote:
>When the user enters a date in a date field, I need to have the day of the
>week autofill in a separate text box.



Just use an expression:
=Format(datetextbox, "dddd")

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      11th Jun 2005
You'll use something like this in the fields control source...

=Format(DatePart("w", Now), "dddd")

Chuck Willey wrote:
> When the user enters a date in a date field, I need to have the day of the
> week autofill in a separate text box.
>
> I'm stumped, please help...
>
>
>
>

 
Reply With Quote
 
=?Utf-8?B?Q2h1Y2sgV2lsbGV5?=
Guest
Posts: n/a
 
      12th Jun 2005
Thanks you guys so much for your help, but I'm still having a problem.

I added a text box on my form, left the control source to unbound, set the
format to "dddd" and it works great. When a date is input to the "date" field
the unbound text box is filled with the day of the week.

The problem is when I set the control source of my unbound text box to my
"Day" field, the "short date" format is shown not the day of the week.

Any ideas?

Thanks again..



"Tony" wrote:

> Try using the lost focus function to populate the other filed when the user
> leaves the date filed with the same data that is in the filed the user enters
> the date in but change the format of the new field to dddd for day of the
> week.
>
> -Tony
>
> "Chuck Willey" wrote:
>
> >
> > When the user enters a date in a date field, I need to have the day of the
> > week autofill in a separate text box.
> >
> > I'm stumped, please help...
> >
> >
> >
> >

 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      14th Jun 2005
=?Utf-8?B?Q2h1Y2sgV2lsbGV5?= <(E-Mail Removed)>
wrote in news:C6CBE3DF-7922-4924-B33F-(E-Mail Removed):

> The problem is when I set the control source of my unbound text box to
> my "Day" field, the "short date" format is shown not the day of the
> week.


The one and only use for the field Format property is to be a default for
controls bound to it... I'm a bit surprised that it would overwrite a
value already there, but nothing surprised me a lot in Access these days.

a) What happens when you set the format of the control back to "dddd";
what happens if you set the format property of the field to "dddd" and
repeat the binding of the control to it;

b) are you really really sure that the date field is definitely a
DateTime data type (sorry... but if it's already a text field, then a
format property is not going to change it to anything)

c) is there a difference between the behaviour when the control has the
focus and when it's just sitting there unmolested.

d) is there any code in the OnCurrent or OnGotFocus events etc that could
be interfering with its behaviour?

All the best

Tim F

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Form Date Autofill Field Gabriella777_2 Microsoft Word Document Management 1 21st Aug 2008 03:39 PM
Time/Date Autofill only on certain field Enter Kyle Microsoft Access 5 23rd Sep 2003 04:41 AM
Re: Autofill current date in field on form Mike Mueller Microsoft Access Forms 0 8th Jul 2003 06:06 PM
RE: Autofill current date in field on form Dean Microsoft Access Forms 0 8th Jul 2003 05:56 PM
Autofill current date in field on form LLR Microsoft Access Forms 0 8th Jul 2003 05:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:10 AM.