Serial Date

  • Thread starter Thread starter David W
  • Start date Start date
D

David W

I might be doing this wrong

I am trying to set a textbox to a serial date using

Me.setserial = DateSerial(Me.Combo4, Me.month, 1)

Me.Combo4 is the year(has the years 1970-2050 for a row source)
Me.month is a combobox with the months set in it.

When I am in debug, you can hold the mouse over the year and see the year
2005, and when you hold the mouse over month you can see the March which
were selected.

where did I go wrong?
 
David W said:
I might be doing this wrong

I am trying to set a textbox to a serial date using

Me.setserial = DateSerial(Me.Combo4, Me.month, 1)

Me.Combo4 is the year(has the years 1970-2050 for a row source)
Me.month is a combobox with the months set in it.

When I am in debug, you can hold the mouse over the year and see the
year 2005, and when you hold the mouse over month you can see the
March which were selected.

where did I go wrong?

You don't actually say what the problem is, but maybe you have the
months listed in Me.month by name, rather than by number. If so, what
you can do is have the combo box's bound column be the month number,
1-12, but hide that column and make the second, visible column be the
name of the month.

You should avoid using the name "month" for a control or field, though,
since Month() is the name of a built-in function and you could
potentially run into some confusion some day.
 
Back
Top