Choosing Dates From Combo

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am looking for a simple but effective way to select a month, in the format
"June 07", on a form.

Should i put the months in a table and use a combo box?

Thanks
 
Add a calendar control named Calendar to your form. That gives you the
ability to select any month in any year.You can then get what you want with:
Format(Me!Calendar.Value, "mmmm yy")

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
Steve said:
Add a calendar control named Calendar to your form. That gives you the
ability to select any month in any year.You can then get what you want with:
Format(Me!Calendar.Value, "mmmm yy")

--
This is to inform 'newbees' here about PCD' Steve:
http://home.tiscali.nl/arracom/whoissteve.html
Until now 3350+ pageloads, 2250+ first-time visitors (these figures are rapidly increasing)

To PCD' Steve: (this is also to inform those who do not understand...)
This is *not* about the sigline...(although you are far away from a 'resource' status).
But we will simply continue to hunt down *each and every* of your posts.

Why???
Because you are the ONLY person here who continues to advertise in the groups.

It is not relevant whether you advertised in *this* particular post or not...
==> We want you to know that these groups are *not* your private hunting grounds!

For those who don't like too see all these messages:
==> Simply killfile 'StopThisAdvertising'.
Newbees will still see this warning-message.

ArnoR
 
No, you should not use a table. I would not suggest a combo box, but if that
is what you want, here is a function that will return a string formatted so
it can be used as a value list row source for a combo. Pass it a date with
the first month/year you want to display, and the number of months you want
to display.

Public Function DateString(dtmStartFrom, lngMos) As String
Dim dtmAddDate As Date
Dim lngYears As Long

For lngYears = 0 To lngMos - 1
DateString = DateString & Format(DateAdd("m", lngYears,
dtmStartFrom), "mmm yy") & ";"
Next lngYears
DateString = Left(DateString, Len(DateString) - 1)

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top