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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|