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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement