Cycle through Open Forms

  • Thread starter Thread starter David W
  • Start date Start date
D

David W

I am using
For intX = intCount To 0 Step -1
If Forms(intX).name <> "excessidle" Then
If Forms(intX).name <> "welcome" Then
i = Forms!welcome.lug
Forms!welcome("ham" & i) = Forms(intX).name
Forms!welcome.lug = Forms!welcome.lug + 1
DoCmd.Close acForm, Forms(intX).name, acSaveYes
End If
End If
Next
to cycle through open forms and close them when excessive idle time is
detected, then my program loggouts the current user. I have put a series of
text boxes on the main form to catch any open forms names so that when they
log back in, I can open the forms they had previously been in.
When this procedure steps through each open form I noticed that 99% of the
forms were listed twice.
Is there a way to only list them once?
 
Hi,


I haven't try myself, but can you add a DoEvents after the DoCmd. I
suspect a *possible* multi-thread timing problem between the VBA thread of
execution and the possible DoCmd execution (don't take it for cash, it is
only speculations).


Vanderghast, Access MVP
 
Back
Top