List month and year

mu

Registered User.
Local time
Today, 11:37
Joined
May 22, 2002
Messages
18
Hi all

I have downloaded and looked through various db's and have searched this forum trying to find a way of populating a combo or list box with the values I want. I don't think it should be that difficult and thought somebody somewhere would have used it but can't find any examples.

Anyway, what I am trying to do is place a combo/list box on my form that will list the current month "MMM YY" and also list below each of the previous months for 12 months. The idea being I will have various data on a subform based on the month selected. I have tried various ways with

= DateAdd ("m";-1;Date())

and others but can't seem to get the desired result.

Thanks
 
You should be able to use a query:

SELECT Date(), DateAdd("m", -1, Date()), DateAdd("m", -2, Date())...
FROM ...

The trick would be I think you'd need a 1 record table for the FROM, or you'd get multiples. I often have a local table that holds user defaults or criteria, so I'd use that.
 
Thanks pbaldy, i will give that a go
 

Users who are viewing this thread

Back
Top Bottom