R
RussCRM
I want to use a combo box with a list of months to set a date range to
two text boxes, txtStartDate and txtEndDate.
My combo box (cboMonth) has two columns, one with a number for the
month such as 1 (for January), 2 ( for February), 3 (for March), etc.
The other column is the month name, which is the visible column. I
also have a cboYear box with the year. When the user selects a month
in cboMonth, I want to set the date range (used by a query/form) to
the date range for that month. However, when I select January, I get
12/1/2007 to 12/31/2007 and 1/1/2008 and 1/31/2008 for all the other
months. Am I doing something wrong?
Here's my code in the AfterUpdate for my cboMonth box:
txtStartDate = DateSerial([cboYear], Month([cboMonth]), 1)
txtEndDate = DateSerial([cboYear], Month([cboMonth]) + 1, 0)
two text boxes, txtStartDate and txtEndDate.
My combo box (cboMonth) has two columns, one with a number for the
month such as 1 (for January), 2 ( for February), 3 (for March), etc.
The other column is the month name, which is the visible column. I
also have a cboYear box with the year. When the user selects a month
in cboMonth, I want to set the date range (used by a query/form) to
the date range for that month. However, when I select January, I get
12/1/2007 to 12/31/2007 and 1/1/2008 and 1/31/2008 for all the other
months. Am I doing something wrong?
Here's my code in the AfterUpdate for my cboMonth box:
txtStartDate = DateSerial([cboYear], Month([cboMonth]), 1)
txtEndDate = DateSerial([cboYear], Month([cboMonth]) + 1, 0)