Normal Topic Date Formats (Read 976 times)
dcostanzo
Junior Member
Members
**
Offline


No personal text

Posts: 58
Joined: Mar 13th, 2003
Date Formats
Apr 28th, 2010 at 3:55pm
Print Post Print Post  
Hello,

working in a new *.db.

I have three date elements. (bound to type date)

Date Received
Date Transfer
Date Shipped

Q - can these element dates be formatted in the Program Editor  so you can type in
     04282010 and it format upon exit 04/28/2010 ?


I appreciate anyones comments
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Date Formats
Reply #1 - Apr 28th, 2010 at 4:30pm
Print Post Print Post  
Hello Dave,

No there is not. None of the events in the programming editor will run between the time the user leaves the field and the data is taken to be formatted as a date. To use a date field, There needs to be some sort of separator between the Month, day and year. A Period, Space, Dash, or Slash. Any of those will work so Sesame knows where one part of the date stops and the next begins.

It is possible to do with a few unbound text box that appear over the date boxes, once data is entered into them they parse the data, set the date field, and set themselves to be invisible. But then you're back in the same problem if the user wants to clear the date out and type a new one into what is now the date field.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
dcostanzo
Junior Member
Members
**
Offline


No personal text

Posts: 58
Joined: Mar 13th, 2003
Re: Date Formats
Reply #2 - Apr 28th, 2010 at 6:41pm
Print Post Print Post  
Thanks for your comments... 

I think the data entry user was looking for a faster input ...  ok good to know.

  
Back to top
 
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: Date Formats
Reply #3 - Apr 29th, 2010 at 1:35pm
Print Post Print Post  
I use the below code (Element::ImmediateChange) to prevent the "@" symbol from being used in an inventory description.   

Could you use something similar that would key on the "/" so that the user could key, for example, "04/28" and the code would trigger on the "/" and capture the "04/28" and replace it with "04/28/2010" ?

If @Right(ItemDesc, 1) = "@"
  {
     @MsgBox("the '@@' trademark symbol (above the 2) is not allowed in the ItemDesc description", "", "")
     ItemDesc = @Left(ItemDesc, @Len(ItemDesc) - 1)
  }
  

Larry
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Date Formats
Reply #4 - Apr 30th, 2010 at 3:10am
Print Post Print Post  
Overlay a visible Text element on top of the Date element.  Make the Date element invisible.
Enter the digits into the Text element, On Exit, parse the digits into mm/dd/yyyy, send the result into the Date element, and clear the Text element.  Now make the text element invisible, and make the Date element visible.

This would work OK if the Date element is blank.  Would need to make some modification to change the date.  (An extra/invalid char in the Date field?), This could trigger code to make the Date element invisible, copy the content to the text field that is now made visible, and can now be edited.  Or just show an empty text element to do direct data entry vs. editing.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged