
Bug In VB4? Won't accept zero length date.
says...
Quote:
>> Thanks for the response. Unfortunately it is not. I finally ended up
>> calling Microsoft on this. They inform me that this is an issue under
>> dispute (or investigation). They gave me a workaround.
>> 1. Put a phony date in the text box so that the rest of bound data will
>> be saved.
>> 2. Then set the underlying data field to Null to make data right.
>> 3. Then set text box back to empty (if necessary).
>> Seems pretty hokie to me. Hope a fix comes out.
>Where did they suggest placing this code? I assume that #1 must be in the
>Data1_Validate event. I can't imagine where #2 and #3 belong.
I lost a nights sleep over this one.
You can't do #2 by referencing the data control recordset object (I have
tried). You could probably do it with a SQL update or by using a DAO method.
I found another solution that may be helpful to you. In the GetFocus event of
the text box that will contain a date do an UpdateRecord on the data set and
place a BeginTrans. In the LostFocus event, test to see if the text box text >
"". If it is, do a Rollback. If not, Do a CommitTrans.
This is hokey too, and for the moment I've decided to tell our users to 'Be
Careful' with date fields. (Unacceptable!)
Of course, this won't work for pre-existing dates.
Alan Norton | Pecos SoftWare Works | With land in your hand
(520) 886-1307 | Visual Basic | then invest in the church
Tucson, AZ \./ \./ for your Heaven. Genesis-
/'\ /'\ Get Em Out By Friday