A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Dateserial same every time



 
 
Thread Tools Display Modes
  #1  
Old February 10th, 2010, 07:34 PM posted to microsoft.public.access.forms
szag via AccessMonster.com
external usenet poster
 
Posts: 99
Default Dateserial same every time

I don't know what I am doing wrong but I am using DateSerial as a default in
a textbox and no matter what I keep getting 1/31/2010.

I have tried to put in anything just to get it to be something other than
1/31/2010...DateSerial(Year(Date()),Month(Date()),0) AND DateSerial(Year
(DateField), Month(DateField)+1,0) AND even tried to hard code DateSerial
(2005,12,12)...still got 1/31/2010!

What I doing something wrong? Thanks in advance...

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1

  #2  
Old February 10th, 2010, 08:27 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Dateserial same every time

I can understand why you'd get 1/31/2010 for that first version -- you told
Access to return the 0'th day of the current month, which translates to the
last day of the previous month (i.e., 1/31/2010!).

If you put that in first, as the default value, then created a new record,
that record would use that default, and you'd see 1/31/2010.

If you then changed the formula/expression for the default value, that will
only affect any NEW records you add. Did you add any new records?

Where are you seeing "1/31/2010"? Only in the form, but never in the table
that underlies the form?

Is that textbox bound to a field in the table (or query)?

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"szag via AccessMonster.com" u2885@uwe wrote in message
news:a370250395b48@uwe...
I don't know what I am doing wrong but I am using DateSerial as a default
in
a textbox and no matter what I keep getting 1/31/2010.

I have tried to put in anything just to get it to be something other than
1/31/2010...DateSerial(Year(Date()),Month(Date()),0) AND DateSerial(Year
(DateField), Month(DateField)+1,0) AND even tried to hard code DateSerial
(2005,12,12)...still got 1/31/2010!

What I doing something wrong? Thanks in advance...

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1



  #3  
Old February 10th, 2010, 08:51 PM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Dateserial same every time

I had a wild thought - maybe the under lying field the textbox is bound to
has 1/31/2010 stored in the table.

--
Build a little, test a little.


"szag via AccessMonster.com" wrote:

I don't know what I am doing wrong but I am using DateSerial as a default in
a textbox and no matter what I keep getting 1/31/2010.

I have tried to put in anything just to get it to be something other than
1/31/2010...DateSerial(Year(Date()),Month(Date()),0) AND DateSerial(Year
(DateField), Month(DateField)+1,0) AND even tried to hard code DateSerial
(2005,12,12)...still got 1/31/2010!

What I doing something wrong? Thanks in advance...

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1

.

  #4  
Old February 10th, 2010, 10:20 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Dateserial same every time

On Wed, 10 Feb 2010 19:34:44 GMT, "szag via AccessMonster.com" u2885@uwe
wrote:

I don't know what I am doing wrong but I am using DateSerial as a default in
a textbox and no matter what I keep getting 1/31/2010.

I have tried to put in anything just to get it to be something other than
1/31/2010...DateSerial(Year(Date()),Month(Date()),0) AND DateSerial(Year
(DateField), Month(DateField)+1,0) AND even tried to hard code DateSerial
(2005,12,12)...still got 1/31/2010!

What I doing something wrong? Thanks in advance...


I don't think there's anything wrong with your code, just your expectations!

That dateserial expression will cause any new record to have the last day of
the previous month entered (unless you overtype it).

What do you WANT the field to contain?

--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.