problem with update or insert statement (1 Viewer)

R

rfcshade

Guest
I have 3 update or insert statements that will run based on an if statement. If I run in debug mode and F11 through the whole code, everything works fine and my database table updates correctly, but if I run the program without brakpoints, my table gets populated one month off. Jan's data is in Feb, Feb is in March and so on. Is there anything that would cause this weird behavior? I'll give more information if needed.
 
R

rfcshade

Guest
I figured it out. I was updating a table that with one row that was being used in a query. Apparently, I needed to close that connection and open a new one to finish the rest of my code. The way I had it written, it was using the old row and then updated that row for the next one to use. I needed it to update first then use that value for the rest of the statement.
 

Users who are viewing this thread

Top Bottom