允许从空的非字符字段跳离
下面这段DataWindow的ItemError事件脚本,将允许非字符字段为空并移到下一列。它对所有的DataWindow有效。
string s
s = this.dwDescribe(this.GetColumnName()+".coltype")
//s = this.dwDescribe("#"+String(this.GetColumn())+".coltype")
CHOOSE CASE s
CASE "number"
IF Trim(this.GetText()) = "" THEN
int null_num
SetNull(null_num)
this.SetItem(this.GetRow(),this.GetColumn(),null_num)
this.SetActionCode(3)
END IF
CASE "date"
IF Trim(this.GetText()) = "" THEN
date null_date
SetNull(null_date)
this.SetItem(this.GetRow(),this.GetColumn(),null_date)
this.SetActionCode(3)
END IF
CASE "time"
IF Trim(this.GetText()) = "" THEN
time null_time
SetNull(null_time)
this.SetItem(this.GetRow(),this.GetColumn(),null_time)
this.SetActionCode(3)
END IF
CASE "datetime"
IF Trim(this.GetText()) = "" THEN
date null_datetime
SetNull(null_datetime)
this.SetItem(this.GetRow(),this.GetColumn(),null_datetime)
this.SetActionCode(3)
END IF
END CHOOSE
页:
[1]