Month, Default Value

romio

Registered User.
Local time
Yesterday, 23:08
Joined
Apr 20, 2005
Messages
68
I have a month field on my table, I have tried to ass "Now()" on the Default Value, but its not seems to be working, what I want is when the form is opened the default value would be the current month.

Thanks.
 
I could use the year as Year(Now()) and month as Month(Now()) but I need to display the month as a name not a number
 
I found that I could use MonthName(Now()) but I get this error:

Invalided procedure call or argument

The field format is text I am not sure if this could affect.
 
Why not use Now() or Date() as your default and format it to display "mmmm"

Remember a date field is stored as a serial number counting the days from 12/30/1899. How the date is displayed is a formatting issue. You have a number of options for formatting.
 
If I understood correctly this is what I have done,
FieldNmae: Month
Data Type: Text
Format: "mmmm"
Default Value: Now()

If that’s how it should be then its not working, the combo box loads is empty when I open the form.

Thanks.
 
You can't set a Text data type to NOW() that's a date value. You want to use a Date/Time datatype. If you use a Text type and just want to STORE the month name, then try this as the default:

=FORMAT(DATE(),"mmmm")

Not sure where a combobox comes in. This is the first time you are mentioning that. Are you setting this default for a combo that chooses the month? If so what is the RowSource of the combo

After reading Doc's response I have to agree that there is something missing here. In the General category there is a sticky that links here:
http://www.catb.org/~esr/faqs/smart-questions.html

You might want to read that before posting new questions. Will save all of us time and headaches.
 
Last edited:
I'm concerned because it SEEMS to me that you haven't told us all of what you really want here.

When you open the table, Now() will be current date, surely enough, though you might have to format it as ScottGem suggests. But are you talking only about NEW records having Now() as their default or were you looking for more than that? After reading your question twice, I still have that nagging feeling that a vital factor in this problem description has been missed somehow.
 

Users who are viewing this thread

Back
Top Bottom