"Simple" date question

hiwelcome

Registered User.
Local time
Today, 00:22
Joined
Aug 14, 2015
Messages
47
I have a combo box on a form which I would like to default to the current month (August for example) but which also has a drop down for the user to choose a different month. The problem I'm having is that if I set the field in the table as a Date/Time, it gives an error when trying to store a month name. But when I set it as Text data type, I can't figure out how to set the default value to the current month. I used "simple" in the subject because it's probably really easy or something dumb I'm doing wrong, but help appreciated.
 
I have a table: tMonths
MoNum, month
1, Jan
2, Feb
etc...
because text wont sort in month order
so the combo box has 2 fields, in the query,
[Month] shows, but its sorted on [MoNum]
default col is MoNum, col width = 0 so users cant see it.
but the value of the combo is MoNum
 
Without having had the time to try it quite yet, that would seem to solve the data type error (I assume use a text data type?), but it doesn't seem to set it so the default month appears in the text box. Am I missing it?
 
How about a default value of

Month(Date())
 
Using Ranman's suggestion and then yours, pbaldy, gets me to a point where the combo box on form open defaults to 8. Two problems with this, one I would need it to display August, not "8," and two and more importantly, as soon as I change any of the other combo box values on the form, the "8" turns into "Month(Date())" in the combo box and in the table.
 
You missed Ranman's comment about column widths, which controls what value you see. Where did you put that formula? It should only be in the default value property of the combo.
 
I got the combo box working. However, it appears to be storing "8" in the table instead of "August"...is there a way to change that?

Either way, thanks to both of you.
 
That's controlled by the bound column, but I'd store the number.
 

Users who are viewing this thread

Back
Top Bottom