Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Userform problem

Sorry... I'm sort of reposting this since I received no answer from my first
post. This time I will show some sample code.

I have 3 userforms:

'Userform1
Private Sub CommandButton1_Click()
userform2.Show
End Sub


'Userform2
Private Sub CommandButton1_Click()
userform2.Hide
End Sub

Private Sub TextBox1_Change()
If TextBox1.TextLength = 4 Then
If TextBox1.Text = "5555" Then
userform2.Hide
userform1.Hide
Userform3.Show
End If
End If
End Sub

'Userform3
Private Sub CommandButton2_Click()
Userform3.Hide
userform1.Show
End Sub

When I click the commandbutton1 on userform1 it shows userform2, when I type
"5555" into textbox1 then userform3 shows and userform1 and 2 hide, if I
click Commandbutton2 on Userform3, Userform3 hides and Userform1 shows...
the problem is if I try to do the same sequence again. The textbox1 events
don't work the second time.
Do anyone know why this is happening, and does someone know how to make this
work?
Thanks in Advance... and sorry again for the repost!

Craig



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform problem

'Userform1
Private Sub CommandButton1_Click()
userform2.Show
msgbox "Userform1.CommandButton1 Ends"
End Sub


'Userform2
Private Sub CommandButton1_Click()
userform2.Hide
Msgbox "Userform2.CommandButton1 Ends"
End Sub

Private Sub TextBox1_Change()
If TextBox1.TextLength = 4 Then
If TextBox1.Text = "5555" Then
userform2.Hide
userform1.Hide
Userform3.Show
End If
End If
msgbox "Userform2.TextBox1 Ends"
End Sub

'Userform3
Private Sub CommandButton2_Click()
Userform3.Hide
userform1.Show
msgbox "Userform3.Commandbutton2 Ends"
End Sub

Try it that way. Do your events end, or are they still being executed -
thus perhaps causing your problem.

--
Regards,
Tom Ogilvy



"Craig M" wrote in message
news:sZDUg.87728$5R2.8797@pd7urf3no...
Sorry... I'm sort of reposting this since I received no answer from my
first post. This time I will show some sample code.

I have 3 userforms:

'Userform1
Private Sub CommandButton1_Click()
userform2.Show
End Sub


'Userform2
Private Sub CommandButton1_Click()
userform2.Hide
End Sub

Private Sub TextBox1_Change()
If TextBox1.TextLength = 4 Then
If TextBox1.Text = "5555" Then
userform2.Hide
userform1.Hide
Userform3.Show
End If
End If
End Sub

'Userform3
Private Sub CommandButton2_Click()
Userform3.Hide
userform1.Show
End Sub

When I click the commandbutton1 on userform1 it shows userform2, when I
type "5555" into textbox1 then userform3 shows and userform1 and 2 hide,
if I click Commandbutton2 on Userform3, Userform3 hides and Userform1
shows... the problem is if I try to do the same sequence again. The
textbox1 events don't work the second time.
Do anyone know why this is happening, and does someone know how to make
this work?
Thanks in Advance... and sorry again for the repost!

Craig





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Userform problem

OK... when I press userform1.commandbutton1 the userform2 shows but the
Msgbox doesn't display. After Userform2 shows if I click
Userform2.Commandbutton1 to hide Userform2 then Userform2 Msgbox fires and
then userform1 Msgbox fires. So I see it isn't firing when it should be...
can I fix this? The userfrom2.textbox1 fired on the first 3 keystrokes but
didn't on the 4th keystroke then it moved on to userform3... when I pressed
userforms.commandbutton the msgbox didn't fire.... but when I closed the
routine via VBA all the msgbox events fire that hadn't!
I know that it will work if I don't hide the Userform1 when it shows
userform3.

There must be a way to make this work, how do other people add user names
and passwords for entry?
Craig

"Tom Ogilvy" wrote in message
...
'Userform1
Private Sub CommandButton1_Click()
userform2.Show
msgbox "Userform1.CommandButton1 Ends"
End Sub


'Userform2
Private Sub CommandButton1_Click()
userform2.Hide
Msgbox "Userform2.CommandButton1 Ends"
End Sub

Private Sub TextBox1_Change()
If TextBox1.TextLength = 4 Then
If TextBox1.Text = "5555" Then
userform2.Hide
userform1.Hide
Userform3.Show
End If
End If
msgbox "Userform2.TextBox1 Ends"
End Sub

'Userform3
Private Sub CommandButton2_Click()
Userform3.Hide
userform1.Show
msgbox "Userform3.Commandbutton2 Ends"
End Sub

Try it that way. Do your events end, or are they still being executed -
thus perhaps causing your problem.

--
Regards,
Tom Ogilvy



"Craig M" wrote in message
news:sZDUg.87728$5R2.8797@pd7urf3no...
Sorry... I'm sort of reposting this since I received no answer from my
first post. This time I will show some sample code.

I have 3 userforms:

'Userform1
Private Sub CommandButton1_Click()
userform2.Show
End Sub


'Userform2
Private Sub CommandButton1_Click()
userform2.Hide
End Sub

Private Sub TextBox1_Change()
If TextBox1.TextLength = 4 Then
If TextBox1.Text = "5555" Then
userform2.Hide
userform1.Hide
Userform3.Show
End If
End If
End Sub

'Userform3
Private Sub CommandButton2_Click()
Userform3.Hide
userform1.Show
End Sub

When I click the commandbutton1 on userform1 it shows userform2, when I
type "5555" into textbox1 then userform3 shows and userform1 and 2 hide,
if I click Commandbutton2 on Userform3, Userform3 hides and Userform1
shows... the problem is if I try to do the same sequence again. The
textbox1 events don't work the second time.
Do anyone know why this is happening, and does someone know how to make
this work?
Thanks in Advance... and sorry again for the repost!

Craig







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform problem

The reason it doesn't work is that you have a long string of events tied up
because they can't end.

Show your userforms as Modeless rather than modal and maybe that will work
for you.

--
Regards,
Tom Ogilvy

"Craig M" wrote in message
news:DwFUg.92324$R63.28980@pd7urf1no...
OK... when I press userform1.commandbutton1 the userform2 shows but the
Msgbox doesn't display. After Userform2 shows if I click
Userform2.Commandbutton1 to hide Userform2 then Userform2 Msgbox fires and
then userform1 Msgbox fires. So I see it isn't firing when it should
be... can I fix this? The userfrom2.textbox1 fired on the first 3
keystrokes but didn't on the 4th keystroke then it moved on to
userform3... when I pressed userforms.commandbutton the msgbox didn't
fire.... but when I closed the routine via VBA all the msgbox events fire
that hadn't!
I know that it will work if I don't hide the Userform1 when it shows
userform3.

There must be a way to make this work, how do other people add user names
and passwords for entry?
Craig

"Tom Ogilvy" wrote in message
...
'Userform1
Private Sub CommandButton1_Click()
userform2.Show
msgbox "Userform1.CommandButton1 Ends"
End Sub


'Userform2
Private Sub CommandButton1_Click()
userform2.Hide
Msgbox "Userform2.CommandButton1 Ends"
End Sub

Private Sub TextBox1_Change()
If TextBox1.TextLength = 4 Then
If TextBox1.Text = "5555" Then
userform2.Hide
userform1.Hide
Userform3.Show
End If
End If
msgbox "Userform2.TextBox1 Ends"
End Sub

'Userform3
Private Sub CommandButton2_Click()
Userform3.Hide
userform1.Show
msgbox "Userform3.Commandbutton2 Ends"
End Sub

Try it that way. Do your events end, or are they still being executed -
thus perhaps causing your problem.

--
Regards,
Tom Ogilvy



"Craig M" wrote in message
news:sZDUg.87728$5R2.8797@pd7urf3no...
Sorry... I'm sort of reposting this since I received no answer from my
first post. This time I will show some sample code.

I have 3 userforms:

'Userform1
Private Sub CommandButton1_Click()
userform2.Show
End Sub


'Userform2
Private Sub CommandButton1_Click()
userform2.Hide
End Sub

Private Sub TextBox1_Change()
If TextBox1.TextLength = 4 Then
If TextBox1.Text = "5555" Then
userform2.Hide
userform1.Hide
Userform3.Show
End If
End If
End Sub

'Userform3
Private Sub CommandButton2_Click()
Userform3.Hide
userform1.Show
End Sub

When I click the commandbutton1 on userform1 it shows userform2, when I
type "5555" into textbox1 then userform3 shows and userform1 and 2 hide,
if I click Commandbutton2 on Userform3, Userform3 hides and Userform1
shows... the problem is if I try to do the same sequence again. The
textbox1 events don't work the second time.
Do anyone know why this is happening, and does someone know how to make
this work?
Thanks in Advance... and sorry again for the repost!

Craig









  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Userform problem

Thanks Tom.... If I show Userform1 and 3 modeless then it works fine...
Thanks
Craig

"Tom Ogilvy" wrote in message
...
The reason it doesn't work is that you have a long string of events tied
up because they can't end.

Show your userforms as Modeless rather than modal and maybe that will work
for you.

--
Regards,
Tom Ogilvy

"Craig M" wrote in message
news:DwFUg.92324$R63.28980@pd7urf1no...
OK... when I press userform1.commandbutton1 the userform2 shows but the
Msgbox doesn't display. After Userform2 shows if I click
Userform2.Commandbutton1 to hide Userform2 then Userform2 Msgbox fires
and then userform1 Msgbox fires. So I see it isn't firing when it
should be... can I fix this? The userfrom2.textbox1 fired on the first 3
keystrokes but didn't on the 4th keystroke then it moved on to
userform3... when I pressed userforms.commandbutton the msgbox didn't
fire.... but when I closed the routine via VBA all the msgbox events fire
that hadn't!
I know that it will work if I don't hide the Userform1 when it shows
userform3.

There must be a way to make this work, how do other people add user
names and passwords for entry?
Craig

"Tom Ogilvy" wrote in message
...
'Userform1
Private Sub CommandButton1_Click()
userform2.Show
msgbox "Userform1.CommandButton1 Ends"
End Sub


'Userform2
Private Sub CommandButton1_Click()
userform2.Hide
Msgbox "Userform2.CommandButton1 Ends"
End Sub

Private Sub TextBox1_Change()
If TextBox1.TextLength = 4 Then
If TextBox1.Text = "5555" Then
userform2.Hide
userform1.Hide
Userform3.Show
End If
End If
msgbox "Userform2.TextBox1 Ends"
End Sub

'Userform3
Private Sub CommandButton2_Click()
Userform3.Hide
userform1.Show
msgbox "Userform3.Commandbutton2 Ends"
End Sub

Try it that way. Do your events end, or are they still being executed -
thus perhaps causing your problem.

--
Regards,
Tom Ogilvy



"Craig M" wrote in message
news:sZDUg.87728$5R2.8797@pd7urf3no...
Sorry... I'm sort of reposting this since I received no answer from my
first post. This time I will show some sample code.

I have 3 userforms:

'Userform1
Private Sub CommandButton1_Click()
userform2.Show
End Sub


'Userform2
Private Sub CommandButton1_Click()
userform2.Hide
End Sub

Private Sub TextBox1_Change()
If TextBox1.TextLength = 4 Then
If TextBox1.Text = "5555" Then
userform2.Hide
userform1.Hide
Userform3.Show
End If
End If
End Sub

'Userform3
Private Sub CommandButton2_Click()
Userform3.Hide
userform1.Show
End Sub

When I click the commandbutton1 on userform1 it shows userform2, when I
type "5555" into textbox1 then userform3 shows and userform1 and 2
hide, if I click Commandbutton2 on Userform3, Userform3 hides and
Userform1 shows... the problem is if I try to do the same sequence
again. The textbox1 events don't work the second time.
Do anyone know why this is happening, and does someone know how to make
this work?
Thanks in Advance... and sorry again for the repost!

Craig











Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform problem? law Excel Discussion (Misc queries) 0 December 3rd 07 07:54 PM
Userform problem racudd Excel Programming 2 April 14th 06 10:30 PM
userform problem Pierre via OfficeKB.com[_2_] Excel Programming 3 October 14th 05 03:08 PM
Userform from a Userform Problem Adrian Excel Programming 1 October 12th 05 04:57 PM
UserForm Problem mayuss Excel Programming 3 August 9th 04 01:18 PM


All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"