Sytze, To clarify, I meant the Gotfocus() of the Textbox and look out as the dDate=Date() line has been merged with the comment above.
Dave -----Original Message----- From: ProFox [mailto:[email protected]] On Behalf Of Dave Crozier Sent: 19 June 2013 08:36 To: ProFox Email List Subject: RE: Date in Grid Sytze, Sorry, didn't read the fact that you are in a grid. In that case, once again in the Gotfocus() event: * Set the date that you want to override the day of dDate = Date() if This.Value=dDate * This.SelStart = 0 * This.SelLength = 2 cMonthYear = Substr(Dtos(dDate),5,2)+Substr(Dtos(dDate),1,4) cKeys = "{Home}{Del}{Del}" keyboard cKeys endif * return -----Original Message----- From: ProFox [mailto:[email protected]] On Behalf Of Sytze de Boer Sent: 18 June 2013 21:15 To: profox Subject: Re: Date in Grid Dave, as always, really appreciate your help However, this code made zero difference When I "enter" the form/grid, all dates are pre-populated with today's date It is when they want to over ride the date (say from 19/6/2013 to 23/6/2013), thats when I want to just enter the 23, and the rest should follow (month and year) On Tue, Jun 18, 2013 at 7:09 PM, Dave Crozier <[email protected]> wrote: > Sytze, > In the Date TextField put the following in the Gotfocus() Event > > if Empty(This.Value) > This.Value = Date() > keyboard "{backspace}" > > This.SelStart = 0 > This.SelLength = 2 > > endif > > > That should do what you want. > > Dave > > > -----Original Message----- > From: ProFox [mailto:[email protected]] On Behalf Of Sytze de > Boer > Sent: 18 June 2013 03:24 > To: profox > Subject: Date in Grid > > In this instance, I use a grid to enter data, 1 column of which is a > Date field The date fields defaults to today If the user enters 15 and > presses enter, it ends up with "invalid date" > If the user enters 1504 (where the slash is automatic), the system > auto adds the year > > I want it to auto enter the current month and year Possible ? > > -- > Kind regards > Sytze de Boer > Kiss Software > > > --- StripMime Report -- processed MIME parts --- multipart/alternative > text/plain (text body -- kept) > text/html > --- > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

