M
M Skabialka
I have downloaded a couple of the MS Access templates and not liking macros
converted all of the macros on the forms to VBA code. However a lot of the
macros use TempVars, and when changed to code don't always work. Here's an
example
TempVars.Add "ActiveControlValue", "[Screen].[ActiveControl]"
DoCmd.SearchForRecord , "", acFirst, "[ID]=" &
TempVars!ActiveControlValue
TempVars.Remove "ActiveControlValue"
When it gets to the 2nd line above, the value of TempVars!ActiveControlValue
is "[Screen].[ActiveControl]" which is not the ID number the code was
expecting.
What is the purpose of TempVars and how are they supposed to work in
examples such is this, which is the after update on a combo which should be
looking for a record on the form.
converted all of the macros on the forms to VBA code. However a lot of the
macros use TempVars, and when changed to code don't always work. Here's an
example
TempVars.Add "ActiveControlValue", "[Screen].[ActiveControl]"
DoCmd.SearchForRecord , "", acFirst, "[ID]=" &
TempVars!ActiveControlValue
TempVars.Remove "ActiveControlValue"
When it gets to the 2nd line above, the value of TempVars!ActiveControlValue
is "[Screen].[ActiveControl]" which is not the ID number the code was
expecting.
What is the purpose of TempVars and how are they supposed to work in
examples such is this, which is the after update on a combo which should be
looking for a record on the form.