Maybe the issue is that the Session variable isn't stored properly in some cases? Can you figure out which table insert is causing the error? Try writing the session variable value to the page to make sure it is set properly. That error implies that either you are inserting into the Jobs table and the JobID column isn't set as autonumber, or you are inserting into another table and the value of JobID is blank.