J
John Shanley
I hope that this phenom had been dealt with before. I did search and
couldn't find anything.
I've got a multi-userform app used as a front end for a Word document.
The first form is presented for the user to add content. There are at
least 10 screens (the user has the choice to "add" content screens at
the 10th screen).
Each form has an Accept, Cancel, Previous and Forward button. The
Prev. and Forward butons allow the user to browse the existing screen
content. The Accept button writes the screen's content to the Word doc
and the Cancel button offers to save the Doc and drops out of the
userform interface.
I have been reading in existing doc content and populating the screens
in each Initialize event. Then use the click event of each button to
move from screen to screen. I was using the load and unload commands
but that got wacky. I assumed because the init event gets called each
time. So I changed the app to load all forms in the Doc load event and
then use Hide and show to move around.
like this:
Private Sub butPrevious_Click()
Me.Hide
If frmWelcome.Visible = False Then
frmWelcome.Show
End If
End Sub
Private Sub butForward_Click()
Me.Hide
If frmLearningObj.Visible = False Then
frmLearningObj.Show
End If
End Sub
The problem is that when I unexpectedly dropped out of the interface
(continually pressing the Previous button back to the first screen)
and then use f8 to step thru the code line by line, I'm seeing the
code from previous forms firing. It just keeps going back and back.
Eventually getting back to the first screen's code and somehow
unloading itself.
Any clues on why this happening? More importantly, how can I get the
screen's "disconnected"?
Thanks,
JohnS
couldn't find anything.
I've got a multi-userform app used as a front end for a Word document.
The first form is presented for the user to add content. There are at
least 10 screens (the user has the choice to "add" content screens at
the 10th screen).
Each form has an Accept, Cancel, Previous and Forward button. The
Prev. and Forward butons allow the user to browse the existing screen
content. The Accept button writes the screen's content to the Word doc
and the Cancel button offers to save the Doc and drops out of the
userform interface.
I have been reading in existing doc content and populating the screens
in each Initialize event. Then use the click event of each button to
move from screen to screen. I was using the load and unload commands
but that got wacky. I assumed because the init event gets called each
time. So I changed the app to load all forms in the Doc load event and
then use Hide and show to move around.
like this:
Private Sub butPrevious_Click()
Me.Hide
If frmWelcome.Visible = False Then
frmWelcome.Show
End If
End Sub
Private Sub butForward_Click()
Me.Hide
If frmLearningObj.Visible = False Then
frmLearningObj.Show
End If
End Sub
The problem is that when I unexpectedly dropped out of the interface
(continually pressing the Previous button back to the first screen)
and then use f8 to step thru the code line by line, I'm seeing the
code from previous forms firing. It just keeps going back and back.
Eventually getting back to the first screen's code and somehow
unloading itself.
Any clues on why this happening? More importantly, how can I get the
screen's "disconnected"?
Thanks,
JohnS