I believe it does make sense. When the code is executed, either with, or without, the WHERE statement the query is successfully run every single time, while running the program in the debug/release state. The only time the error is thrown is after the application has been built and installed. I have run the code both ways, both through the debugger and on the built/installed versions and the query executes.

I don't believe I need to check if the ID is in the database? I am not sure what the benefit of this code would be. As the code stands now (sans the WHERE statement), there exists a coded first number (named recordID) already there, if the field, colStaffID is Null. I have executed this code many, many, many times and it has always functioned as expected.

When the installed application runs, it is clear to me that everything executes properly up to the point where the UPDATE is run. The UPDATE only fails when the application has been built and installed. I have gone through the whole list of possibilities, thus far, suggested and have not been able to verify that any of those apply.

I honestly no longer can see how the code itself might be at fault (although I am usually wrong with my conclusions where code is concerned). Additionally, I have reviewed a couple of applications I made in the past that use this same ascension numbering system and they all perform as they were expected.

It just seems to me that the answer lies somewhere in my build process and that I probably left something out of the build that was required. Having said that, I have no idea what that would be.

At the end of the day, this application requires that each record have a specific ascension number with a front end two letter designation, and an auto numbered field does not provide what is required. If the strategy that I am using will not provide this (and it has provided just that while creating/testing the application and even functioned in a previous built/installed application), then I will need to come up with an entirely different means to achieve that end.

Anyway, as I read your suggestion my understanding is that this code would do nothing more than check to see if the number exists. Perhaps if you would provide a little context I might be able to figure out where I am going wrong.