1

I have a progress indicator form.

I use the following code to turn it on and off. Turning it off with .visible=false and Set object=nothing works but is the form still open in memory?

dim oProgInd as Form_frmProgressIndicator
set oProgInd = new Form_frmProgressIndicator
   With oProgInd
        .Status="Running Append"
        .visible=true
        .maxRecord=iMxRec
   End with
   Do
      ' some repetitive code
      oProgInd.Tick
   Loop
   oProgInd.visible=false
set oProgInd=nothing

I know Excel VBA uses Unload to close a form. Should I be using some kind of Unload in MS Access VBA.

0

1 Answer 1

1

set oProgInd=nothing will release the reference to the form class object. Since there are presumably no other references to it, it should get closed.

You can confirm in the Immediate window by inspecting the Forms collection:

? forms.Count
' if Count > 0, use this "for each" to see the form names ...
for each frm in forms : ? frm.name : next
Sign up to request clarification or add additional context in comments.

1 Comment

As a heads up, when you set a form variable = nothing, the forms.count will not usually get updated until a do events is executed.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.