On Sep 29, 2006, at 4:08 AM, Bart Pietercil wrote:

Hi,

this code placed in the change event of a Tabpanel gives me a StackOverFlow exception

Sub Change()
  Dim anID As String

  if App.TheCoach.SelectedStudent.HasKey("user_id") then
    anID = App.TheCoach.SelectedStudent.Value("user_id")
    if anID = "0" Then
MsgBox "Nieuwe gebruikers moeten geregistreerd worden bij de leverancier vooraleer deze functionaliteit beschikbaar wordt."
      me.Value = 0
    end if
  Else
    me.Value = 0
  end if
End Sub

What I meant to happen was:

when someone clicks on page 2 (value = 1) and anID = "0" or anID does not exist he has to stay on page 1 (value = 0) of the tabpanel.

What am I doing wrong?

when you set me.value to 0 you get a change event
which pmakes you run this code again and ... you get the idea

at the top of the method add

        static alreadyProcessing as boolean

        if alreadyProcessing = true then return

        alreadyprocessing = true

and at the end add

        alreadyprocessing = false


        
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to