View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
sebastienm sebastienm is offline
external usenet poster
 
Posts: 694
Default User form with looping doesn't start at right place.

Hi,
Seeing part of your code would be helpfull.

It could be that you don't unload the form before starting over which would
cause the Initialize sub not to be re-run.
When a form is displayed for the first time, the Initialize sub is run. Then
if you hide the form (Me.Hide) the form is still there but hidden; once you
do a Show again, the form shows up without running Initialize.
Instead, when hidding the form, do an unload. Next time you show it, the
Initialize sub will be run:
Private Sub cmdOK_Click()
'...
Unload Me
End Sub

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Rominall" wrote:

I have a user form that runs through a list of questions. At form initialize
it runs a couple of macros one of which is a looping Public statement Loop =
loop +1 kind of (I need this to keep track of some other things). When the
user clicks a start over button (sets Loop to 0) the form doesn't start with
the same question as it does when it initializes. What's going on?