Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Show only Date in form from a Datetime field
Message
 
To
15/03/2003 16:17:49
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00766210
Message ID:
00767153
Views:
40
If I have a form that has control bound to a datetime field in a cursor, but I want to display/edit only the date portion, I create a new form property that has access and assign methods. In this access method, it reads the value of the datetime field and converts it with TTOD(). If the value in the datetime field is null (remember that SQL Server does not allow "empty" dates), I then simply convert it to an empty date. Now, on the assign method, I simply take the property's value and replace it into the cursor's field, after I convert it with DTOT(). If the property's value is an empty date, I replace a null value into the cursor's field. Finally, on the form, I set the control's ControlSource property to this new form's property (ie. thisform.dbirthdate) instead of the cursor's field. Works great and the user sees and edits just the date portion.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform