Overdue month, but not on a date field

H

H J

I have a form that the user wanted to have a drop down list of the months
(not a date field formatted as a date, simply a list of the months) they
then want a report based off this field to show overdue reports. How can I
get this to work? I am sure if it was a date field it would be much easier,
but with it being a list I can't use any of the built in date/time
functions.

Thanks.
 
B

Brendan Reynolds

H J said:
I have a form that the user wanted to have a drop down list of the months
(not a date field formatted as a date, simply a list of the months) they
then want a report based off this field to show overdue reports. How can I
get this to work? I am sure if it was a date field it would be much easier,
but with it being a list I can't use any of the built in date/time
functions.

Thanks.


Here's an example which, given a combo box that lists the English-language
names of the twelve months of the year, places a date in a text box that is
the first day of the selected month in the current year.

Private Sub cmdTest_Click()

Me.txtDate = CDate("1 " & Me.cboMonths & " " & Year(Date))

End Sub

Private Sub Form_Load()

Me.cboMonths.RowSourceType = "Value List"
Me.cboMonths.RowSource =
"January;February;March;April;May;June;July;August;September;October;November;December"

End Sub
 
M

MGFoster

H said:
I have a form that the user wanted to have a drop down list of the months
(not a date field formatted as a date, simply a list of the months) they
then want a report based off this field to show overdue reports. How can I
get this to work? I am sure if it was a date field it would be much easier,
but with it being a list I can't use any of the built in date/time
functions.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You'd create the ComboBox's drop-down list with 2 columns: The month
number and the month name. E.g. (the ComboBox's Properties dialog box):

RowSourceType: Value List
RowSource:
1,Jan,2,Feb,3,Mar,4,Apr,5,May,6,Jun,7,Jul,8,Aug,9,Sep,10,Oct,11,Nov,12,D
c

Bound Column: 1
Number of Columns: 2
Column Widths: 0";1"

When the user selects a month name the month number will be the
ComboBox's selected value. Use that month number (and the current
year?) to run the report. Refer to the ComboBox from the report's query
like this:

Forms!FormName!ComboBoxName

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA+AwUBSUZpo4echKqOuFEgEQLpSgCdEkDEJU0ZKynC794AbSqSoYgutegAmIca
5o+PUEE5In5SP0NPPtw+TTg=
=iMK+
-----END PGP SIGNATURE-----
 
Top