Default Value in different formating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
i have created a combo box where it lists the months in mmm yy format. I
have set the default value to be the first in the list. But I always get the
date in mm/dd/yyyy format for the default value only. when I open the list or
choose another date, it will go back to mmm yy format.

any idea to solve this?

Many thanks.
WL
 
If you are only interested in the month and year, why are you recording a
date? From your description, the combo box is bound to an underlying
Date/Time field.
 
I'm confused. Your combobox has only mmm yy displayed, so you are asking
your user to select only a month and year. But you want to sort by date.
How does August 8th, 2004 get into your record when the user can only pick
August, 2004?
 
The drop down list shows the following.

August 2004
July 2004
June 2004
.....
.....
and so on.

I have made the first record in list, which is August now, to be the default
value. the problem is it shows the date as 8/1/2004 when I open the form, and
it change to August 2004 when I select the date from the drop down list.

I hope this will explain it better.

I appreciate your help and patience.

WL
 
I don't think you've answered Jeff's question, but regardless, have you
tried setting the form's format property to "MMMM, yyyy"?

grep
 
I agree with "grep's" posting. Please re-read my response.

How can someone select August, 2004, and how can you then have August 10,
2004 stored -- these are not the same thing.

The fact that August, 2004 is showing up as August 1, 2004 tells you that
the underlying data IS a date, and IS the first of the month. How will you
sort by date if all the dates in August are the first?
 
Oh,
sorry if I confused you. I meant to sort the entries by month.

users should put some sort of data about their projects in monthly basis.
Therefore, I created a list of months from now up to 2050. I ran a quary to
list months less than todays date and I used it as a drop down list in my
form, sorted ofcourse. In the form, I made the default value as first in the
list.

I made the date format as mmm yyyy in both table and form. I got the drop
down list with items formated the same way. but the default value is always
shown as mm/dd/yyyy.

I hope this will explain it.

Thank you
 
Back to my first suggestion then. If you need dates and/or times, use a
date/time field. By storing August, 2004 in a Date/Time field, you HAVE
August 1, 2004. Use a text field if you only want MMMM.

But if you are willing to store the date that the user made the selection
(August 11, 2004), you can still "sort by month". Use a query and use the
Month() function to determine the month portion of a date. NOTE: August
happens in more than one year. If you sort by Month(), you will also need
to sort by Year()!
 
Back
Top