A family of Microsoft relational database management systems designed for ease of use.
I realize now that when the onLoad procedure starts, it also finishes and therefore ends the execution of the procedure and the life of that variable. And this is why when I try to use the same variable in the two onClick procedures, the variables are empty.
That is only true if the variable in question is declared inside the Form_Load procedure. As I said before, if a variable is declared at the module level (on a form), it "lives" as long as that form is open, and is visible to all procedures inside that form's module. It isn't visible to procedures *outside* that form's module -- on some other form, for example -- unless the variable is also declared as Public, and references to it from outside are qualified with a reference to the form containing the variable; e.g.,
Forms!FormName.MyPublicVariable
It's also possible to declare Public variables at the module level in *standard* modules, in which case their lifetime is the lifetime of the application (except in certain circumstances), and references to them don't need to be qualified in any way. These are often referred to as "global" variables. However, using them reliably requires a certain amount of care, so I don't recommend them unless you know what you're doing.
Now, with all that said, I'm not sure why you need module-level or global variables for this. It seems to me that the information you need to move to the "next" or "previous" Entity to be updated is present on the form from which the UpdateEntity form was called. What's to stop you from referring to that form, in your code, to find out which Entity is "next" or "previous"? Either that, or that form coulld pass, via the OpenArgs argument of the OpenForm method, a list of all the selected Entities, which the UpdateEntity form could save in a hidden control and interrogate as needed. You haven't given me the details of the forms and controls involved, so I can't get specific, but controls on forms (whether visible to the user or not) can often be used as convenient places to stash data.