Help on getting variable

Discussion in 'Questions (Windows Mobile)' started by jeterry, Nov 11, 2008.

  1. jeterry

    jeterry Member Licensed User

    I have an application that I am working on that requires the user to indicate a reason why they are deleting an item. The problem is that when you select the reason code from reason table and close the reason code screen the selected code is not being captured.

    I have tried the doevents and also timers events, to no avail. In debug the program complete the sub before it ever gets to the reason screen.

    Could someone please take a look at the attached code and indicate what I am doing wrong. Please note: the get_reason is also used in another part of the full program.


    Thanks for your help:sign0085:
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I'm not sure if that is the case here, but you shouldn't close the form from inside the SelectionChanged event. A timer (set to 10ms) should solve it:

    Code:
    Sub reasonlist_SelectionChanged (ColName, Row)    ' reason code selection
        reasonc = reasonlist.Cell ("R.Code", reasonlist.SelectedRow)    
        
    Msgbox (reasonc)    
        tmrCloseForm.Enabled = 
    True
    End Sub

    Sub tmrCloseForm_Tick
        tmrCloseForm = 
    False
        realist.Close                                
    End Sub
     
  3. jeterry

    jeterry Member Licensed User

    Thanks

    Thanks Erel, that just what the doctor ordered.
    :sign0060:
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice