| 发表于:2007-09-11 23:02:412楼 得分:0 |
--改一下即可: private sub form_load() me.流程单号 = getbillnumber( "pj ") end sub public function getbillnumber(strtype as string) as string dim s as string s = nz(dmax( "流程单号 ", "表名 ", "left(流程单号,2)= ' " & strtype & " ' "), " ") if left(s, 8) <> format(date, "yyyymmdd ") or s = " " then s = format(date, "yyyymmdd ") & "001 " else s = left(s, 8) & right( "000 " & val(right(s, 3)) + 1, 3) end if getbillnumber = s end function | | |
|