I have a question for any VB expert out there. The following module written for Access 97 and viewers in this forum are satisfied with the language. However, at the Module tab (displaying the Run, Design, New buttons) the Run button is shaded and cannot be clicked. What do I have to do to the program so the Run button is usable?
(The table is named Structural 2005. The fields Amount, Units, and Formulation are used to calculate the field Active. All Amounts are entered. I want to use this module to calculate Active for every record in one sweep - as a stand-alone program, so to speak.)
Option Compare Database
Option Explicit
Function DoTheUpdates()
docmd.set warnings false
DoCmd.RunSQL "update [Structural 2005] set Active = Amount * 8.35 * Formulation * 0.01 where Units= 'GAL'"
DoCmd.RunSQL "update [Structural 2005] set Active = Amount/16 * Formulation * 0.01 where Units= 'OZ'"
DoCmd.RunSQL "update [Structural 2005] set Active = Amount * Formulation * 0.01 where Units= 'LBS'"
docmd.set warnings true
End Function
Thanks for any assistance!
(The table is named Structural 2005. The fields Amount, Units, and Formulation are used to calculate the field Active. All Amounts are entered. I want to use this module to calculate Active for every record in one sweep - as a stand-alone program, so to speak.)
Option Compare Database
Option Explicit
Function DoTheUpdates()
docmd.set warnings false
DoCmd.RunSQL "update [Structural 2005] set Active = Amount * 8.35 * Formulation * 0.01 where Units= 'GAL'"
DoCmd.RunSQL "update [Structural 2005] set Active = Amount/16 * Formulation * 0.01 where Units= 'OZ'"
DoCmd.RunSQL "update [Structural 2005] set Active = Amount * Formulation * 0.01 where Units= 'LBS'"
docmd.set warnings true
End Function
Thanks for any assistance!