Text box default date.

uplink600

Registered User.
Local time
Today, 21:03
Joined
Mar 18, 2004
Messages
69
Hi Dudes

I have a text box on a form which is formatted as medium date and I want it to default to the Monday of the following week. So for today it should have 07-Mar-05 in the text box.

Can anyone please advise a method for this.

Thanks

VC
 
Thanks

That sort of helps but I would like the date to appear by default without having to increment like you have shown.

Thanks

VC
 
I just cannot believe your reply!

First of all the only reason that the form increments is to simulate the day to-day aspect of your database. I am just showing you that it will work for all dates that you will encounter in the future, it will always default to the Monday following today's date.

In the example form, "today's date" is the date appearing in the upper left text box. When you press the increment button, "today's date" will change to tomorrow's date, not that you want tomorrow's date in your form, it just shows you that it will work tomorrow!

If you do not understand the functionality of the example, then say so! Do not answer with such a dismissive response.

If that is not what you wanted, (and that is exactly what I got from your question) then please try and explain what you want more clearly!

From one and very irritated person!!!!
 
I won't repeat the message you send me privately, but I will not be answering any more of your posts, and I would advise other people not to bother answering posts from this ignorant person.
 
You are being a big silly Girl aren't you. You will be replying to some more posts dear boy because you'll never know it will be me posting. I've got a few identities for these forums. I will expect the same low calibre replies from you though.
 
Date text box on form

Good Afternoon Guys

I have a text box on a form which, when the form is ready for a new record to be entered, displays the date which corresponds to the Monday of the following week. I need this date to be saved in the record as a follow up date for quotations. The database is recording quotations that we provide and the date is a follow up date which is always on the first day of the next working week. I get this date using the following.

The follow up date text box has the following in the control source

=[QuoteDate]+(8-[Text70])

I have another text box (Text70) with the following in the control source to enable the above to work.

=DatePart("w",[QuoteDate],2)

The formulas work fine and when I test the Database I always have the correct date displayed. The problem I have is that the follow up date is not being recorded in the table record when I close the form, all other data entered is preserved OK. Can someone please advise as I suspect the problem is something simple (I hope).

Hope this is clear and that you can help.

Thanks.
 
The short answer is not to save a value that can be so easily calculated.

A textbox can't be both bound to the table and contain a calculation, as you've seen. You'll either need to copy that calculated value to a bound textbox, or do the calculation in code. However, I wouldn't save it at all; just perform that calculation when you need the date.
 
Thanks

I decided to use code to calculate the FollowUpDate using the form_Current event and the following line of code.

Me.[FollowUpDate].Value = Me.[QuoteDate] + (8 - Me.Text70)

This works fine and the required date (the following Monday) is placed in the FollowUpDate text box which has the FollowUpDate field set as the control source. The correct dates also appear in the records.

However I have a problem with a query which finds all records for follow up using the criteria =Date() against the FollowUpDate field. When I set the system date to next Monday to test the query I find that no records are found even though the FollowUpDate and system date match.

Could you advise why this might be.

Thanks for your help.

VC
 
First thing I would check is to see exactly what is being saved. If you're including a time portion of the date when you save it, you'd have trouble when you tried to match it with a date criteria. Can you post a sample?
 
uplink600 said:
You will be replying to some more posts dear boy

Cut out the crap.

I've got a few identities for these forums.

Why? Your IP is logged. Your IDs are no big secret.

I will expect the same low calibre replies from you though.

Please don't knock the quality of anyone's advice. If you want high calibre advice then bloody well pay for it. This is a free forum and you get what you pay for. :mad:
 
Paul

Please advise what you need to see as I can't upload full DB as the zip file is too big.

Thanks

VC
 
Paul

I did just notice that when I click in the FollowUpDate text box on the form, the entry changes from say 14-Mar-05 to 14/03/2005 20:29:53 so it would seem that there is some time element being saved. All the date controls are formatted as medium date. Is there some input mask or other format I should be using?

Thanks

VC
 

Users who are viewing this thread

Back
Top Bottom