Dim rs As Object
Set rs = CurrentDb.OpenRecordset("tbl")
rs.MoveFirst
For i = 1 To rs.RecordCount
rs.Edit
rs("编号") = Format(rs("日期"), "yyyymmdd") & "-" & Format(Nz(DMax("Right(编号, 2)", "tbl", "left(编号,8)='" & Format(rs("日期"), "yyyymmdd") & "'")) + 1, "00")
rs.Update
rs.MoveNext
Next i
Set rs = Nothing