>>< % . . . >> oPage.Open sql, oConnection, adOpenKeyset, adLockBatchOptimistic, adCmdText >> oPage.movelast >> response.write(sql&"<br>") >> response.write(oPage("st_name")&"<br>") >> with oPage >> .fields("ss_scoping").value = formatdate2(request.form("ss_scoping")) >> .fields("s_scoping").value = formatdate2(request.form("s_scoping")) >> .fields("time_scoping").value = nz(request.form("time_scoping")) >> .fields("as_scoping").value = formatdate2(request.form("as_scoping")) >> .fields("a_scoping").value = formatdate2(request.form("a_scoping")) >> .updatebatch >> >> .fields("ss_scoping").value = formatdate2(request.form("ss_scoping")) >> .fields("s_scoping").value = formatdate2(request.form("s_scoping")) >> .fields("time_scoping").value = nz(request.form("time_scoping")) >> .fields("as_scoping").value = formatdate2(request.form("as_scoping")) >> .fields("a_scoping").value = formatdate2(request.form("a_scoping")) >> .updatebatch >> end with >>% > >>>>
function formatdate2(lddate) if isdate(lddate) then formatdate2 = lddate else set oRS = oConnection.Execute("select {} as blankdate from users") session("blankdate") = oRS.Fields("blankdate").Value formatdate2 = session("blankdate") oRS.close set oRS = nothing end if end functionMy real code did not have multiple updates and of course does not set the same fields twice. But I found that it would fail on the update. So for troubleshooting I added multiple updates to identify the field that was giving the problem. The frustrating thing is that it will sometimes work but usually not even with the same data.