Bob Gajewski
rbgajewski at adelphia.net
Mon Jul 7 20:28:17 CDT 2008
Stuart & William (et al) Yep, it was a syntax error. Instead of: dtStart = Nz(Me.IncidentDate.Value, 0) I had to change it to: dtStart = Nz(Me.IncidentDate.Value, DateAdd("m", -1, Date)) Unfortunately, using the double-click method now loses both the _BeforeUpdate() event and the SelStart, SelLength settings. So, I may not use this after all. Thanks anyways - I was definitely led to my error ("mm" where it should have been "m"). Bob -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Monday, July 07, 2008 01:24 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I change the default month in Leban'sMonthCalendar module? You are doing it in the correct place, the function that calls the calendar is: ShowMonthCalendar(mc, dtStart, dtEnd). This should be in your IncidentDate.Double_Click event handler. However "mm" is not a valid parameter for DateAdd. :-( Try DateAdd("m",-1,Date()) On 6 Jul 2008 at 9:22, Bob Gajewski wrote: > Hi Folks > > I have attempted to use Leban's "MonthControl" solution > (http://www.lebans.com/monthcalendar.htm) for populating a date field > on a form. Of course, it works wonderfully - as programmed. > > However, for the purposes of my specific form, the user will almost > always be entering data from the previous month. If I double-click on > my IncidentDate field today, the popup shows July, August and > September - but they will probably need June. > > Does anyone know where/how I can insert the DateAdd("mm",-1,Date) code > to have the it default to June, July and August (last month, this > month and next month)? I tried to work with the dtStart value, but my > code keeps failing ... > > TIA, > Bob Gajewski > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com