Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Exit event/textbox/frame

Hi guys

I have several groups of textboxes on my form - all surrounded by frames.
For validation I have a exit_event for each textbox.

But when I tab thru my textboxes the exit_event dosn't start on the last
textbox i a frame. and that goes for all the frames.

Can somebody please help?
Regards,
Flemming

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Exit event/textbox/frame

I don't believe the TextFrame supports any events, it just acts as a
container for other objects.

"Flemming Jørgensen" wrote:

Hi guys

I have several groups of textboxes on my form - all surrounded by frames.
For validation I have a exit_event for each textbox.

But when I tab thru my textboxes the exit_event dosn't start on the last
textbox i a frame. and that goes for all the frames.

Can somebody please help?
Regards,
Flemming

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Exit event/textbox/frame

Cant get it to work

Now when I tab out of textbox2 the frame_exit start - and it shouldn't
because there are 3 boxes in the frame..

Here is my code
Private Sub Frame1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call TextBox3_Exit(ByVal Cancel)

End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'This is 1st textbox in Frame1
FeltNr = 2
If Not Valid(FeltNr, "Varme for Hovedmåler") Then
Cancel = True
End If
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'This is 2nd textbox in Frame1
FeltNr = 3
If Not Valid(FeltNr, "Vand for Hovedmåler") Then
Cancel = True
End If
End Sub
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'This is 3rd textbox in Frame1
FeltNr = 4
If Not Valid(FeltNr, "Varme for K12") Then
Cancel = True
End If
End Sub
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'This is 1st textbox in Frame2
FeltNr = 5
If Not Valid(FeltNr, "El for K12") Then
Cancel = True
End If
End Sub


"JLGWhiz" wrote:

I did a little memory refresh on my own head and here is where the problem
lies. The Exit event for a control on a form or in a container such as the
TextFrame, will only fire when the destination is within the immediate
container. That is why it worked for you for the first two tabs within the
same TextFrame but failed when you tabbed to a different frame. I
incorrectly assumed that no exit event applied to the TextFrame since none
was listed in the VBA help file. However, when you check the declarations
menu in the VBA code window for a TextFrame, it lists the exit event. So I
tried it, it works.

The answer to your problem is to use the Exit event of the TextFrame when
moving between Frames. Use the Exit event of the TextBox (or other controls)
when moving between controls withing the same container. Good Luck.

"Flemming Jørgensen" wrote:

I agree. Didn't write that either I think.

As an example.

I have 3 textboxes in 1 frame - When I leave textbox1 and textbox2 with
tab-key, the exit_event start.
But when I tab out of textbox3(last in frame1) into textbox4(first in
frame2) - the exit_event dosn't start.



"JLGWhiz" wrote:

I don't believe the TextFrame supports any events, it just acts as a
container for other objects.

"Flemming Jørgensen" wrote:

Hi guys

I have several groups of textboxes on my form - all surrounded by frames.
For validation I have a exit_event for each textbox.

But when I tab thru my textboxes the exit_event dosn't start on the last
textbox i a frame. and that goes for all the frames.

Can somebody please help?
Regards,
Flemming

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Exit event/textbox/frame

I thought that it might work by putting the executatble code in the standard
module and use the exit event to call it. It worked pretty good going one
way, but when I went back to Frame one it would stop after executing textbox4
code, it continued on and executed the exit event for textbox1. That blew my
mind. I haven't figured that out yet. I think you might have to come up
with an alternative way to do what you want, like don't use the Frames. Just
organize your text boxes on the form in the groups as though they were in
frames.

"Flemming Jørgensen" wrote:

Cant get it to work

Now when I tab out of textbox2 the frame_exit start - and it shouldn't
because there are 3 boxes in the frame..

Here is my code
Private Sub Frame1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call TextBox3_Exit(ByVal Cancel)

End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'This is 1st textbox in Frame1
FeltNr = 2
If Not Valid(FeltNr, "Varme for Hovedmåler") Then
Cancel = True
End If
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'This is 2nd textbox in Frame1
FeltNr = 3
If Not Valid(FeltNr, "Vand for Hovedmåler") Then
Cancel = True
End If
End Sub
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'This is 3rd textbox in Frame1
FeltNr = 4
If Not Valid(FeltNr, "Varme for K12") Then
Cancel = True
End If
End Sub
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'This is 1st textbox in Frame2
FeltNr = 5
If Not Valid(FeltNr, "El for K12") Then
Cancel = True
End If
End Sub


"JLGWhiz" wrote:

I did a little memory refresh on my own head and here is where the problem
lies. The Exit event for a control on a form or in a container such as the
TextFrame, will only fire when the destination is within the immediate
container. That is why it worked for you for the first two tabs within the
same TextFrame but failed when you tabbed to a different frame. I
incorrectly assumed that no exit event applied to the TextFrame since none
was listed in the VBA help file. However, when you check the declarations
menu in the VBA code window for a TextFrame, it lists the exit event. So I
tried it, it works.

The answer to your problem is to use the Exit event of the TextFrame when
moving between Frames. Use the Exit event of the TextBox (or other controls)
when moving between controls withing the same container. Good Luck.

"Flemming Jørgensen" wrote:

I agree. Didn't write that either I think.

As an example.

I have 3 textboxes in 1 frame - When I leave textbox1 and textbox2 with
tab-key, the exit_event start.
But when I tab out of textbox3(last in frame1) into textbox4(first in
frame2) - the exit_event dosn't start.



"JLGWhiz" wrote:

I don't believe the TextFrame supports any events, it just acts as a
container for other objects.

"Flemming Jørgensen" wrote:

Hi guys

I have several groups of textboxes on my form - all surrounded by frames.
For validation I have a exit_event for each textbox.

But when I tab thru my textboxes the exit_event dosn't start on the last
textbox i a frame. and that goes for all the frames.

Can somebody please help?
Regards,
Flemming

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
Dynamically Adding Textbox To Frame sarndt Excel Worksheet Functions 0 March 15th 10 06:19 PM
Exit Event with a single textbox control [email protected] Excel Programming 2 February 9th 06 01:50 AM
Verify the format of the content of a textbox included in a frame Edgar[_2_] Excel Programming 1 October 13th 05 12:15 AM
How To Get An Event To Run When I Exit A TextBox Minitman[_4_] Excel Programming 7 October 22nd 04 11:27 PM
MSForms.TextBox Exit event isn't available in Excel class mosule lacos Excel Programming 2 December 12th 03 10:12 AM


All times are GMT +1. The time now is 09:39 PM.

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"