Can we assume the cmdSet_Click and the Text1_AfterUpdate are on different forms, otherwise there is no need for a global?
Observed that function Div1 does nothing. There is no need to have a function to return a global viable and also, I don't see it used anywhere in the following code.
Query 'varTest2' must be using parameter values which are supplied by the form controls.
The vDiv1 global variable should be assigned the value in the Control? called txtDev1. Comment, if you preface your control names with 'Me.' within the form class then Intellisense will prompt you with a list of the valid control names, otherwise you could type in an invalid control name. If you follow this guideline, Access will not be required to search and resolve the control during runtime, and it will speed up the processing.
If this doesn't help resolve your problem then use the debugger to verify the code. Merely place the cursor on the line to be checked and press (F9). Open the form and perform the update which should stop the processing at the breakpoint. Then take single steps of the code by pressing (F8). Inspect the values with Intellisense or by using the Immediate window.
----------------------
scking@arinc.com
Life is filled with lessons.
We are responsible for the
results of the quizzes.
-----------------------