Monthly Calendar

Jim W

Registered User.
Local time
Today, 19:04
Joined
Feb 4, 2003
Messages
198
Does anyone know if a Monthly calendar is available. I'm trying to have a popup form (Calendar) that a user will select a Month / Year. Something like a list of the Months and a year selector.

Jim
 
I'm not looking for a Date / Time picker. I want to select a Month / Year Picker. So for the examples when a user clicks on a start field I want a popup with the 12 months and a year selector. So if they select May 2004 the field would fill with 5/1/04 and that is all.

Jim
 
It might be easier to just create two combo boxes. One for the month and the other for the year. Fill the combos with the data you allow the user to select from.
 
Sometimes creating your own form is a good way too. I'd still go against storing a month and a year in separate fields and keeping a date which you can break down for querying in the future.

The attached example is a custom month/year picker. It passes a date back (despite only allowing the selection of a month an year) but, once done, you can split this however you want.
 

Attachments

Mile-O-Phile Monthly Calendar

Mile
I have a question reguarding the Monthly Calendar form that you created. 1st off it is very cool and just what I was looking for. I have been trying to make a change to it and was wondering if had any ideas on how to do this. I'm using your form to Select a Month range. So on a form I have A start and end fields. When you select a Month using your form it always goes to the 1st day. I tried using 2 forms 1 for a Start and a second for the End Date.
Then I changed the last number here to 31 but this will only work for months

Forms(strForm)(strControl) = DateSerial(Me.cboYears, Me.fraMonths, 1)

that have 31 days. If you select Feb then the value becomes 3/2/04
Is there a way I can do this?

Jim
 
Hope this helps. It is something I found in a calendar demo

Private Function DaysInMonth(intMonth As Integer, intYear As Integer) As Integer

Dim datSta As Date, datEnd As Date

datSta = DateSerial(intYear, intMonth, 1)
datEnd = DateAdd("d", -1, DateAdd("m", 1, datSta))

DaysInMonth = DateDiff("d", datSta, datEnd)

End Function

'Called as follows:
Private Sub FindDays_Click()
Dim intDays As Long

intDays = DaysInMonth(Me.cboMonth, Me.txtYear)
'Me.cboMonth as the bound column as the No of the month - Jan = 1 etc on the form and Me.txtYear is the year on the form.

msgbox intDays

Dave
 
Thank you for sharing the calendar db. I was able to use the code here to solve my end date issue.

Thanks again for the support

Jim
 

Users who are viewing this thread

Back
Top Bottom