A family of Microsoft relational database management systems designed for ease of use.
Okay, so that makes sense. What appears to be happening is that you have an unhandled error which then you go to debug and instead of sliding the yellow area down to the next line so it will bypass it and continue running you click the STOP DEBUG button and then you lose a global variable which apparently has your connection to SQL Server (or some other data source) open.
So what you need to do is to handle the errors and if you stop to debug, you can just, over on the left hand side of the VBA window, on the yellow line, drag the yellow arrow which points to the code that needs fixing down to the next executable line of code or down to the exit spot of the procedure. Then click F5 to continue running and then go back and fix it.
To fix your code you showed, just use
If Val(Nz(txtValue, 0)) < 0 Then
...etc.