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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only