Shane

When the line in the listview is double clicked it launches this function. I am sending the listview index into the Create_Form function. I have a load button in the main form that allows the user to select a different file. Sometimes these files have different numbers of columns when read into the listview. I have successful implementation the first time it executes the function. However subsequent executions appear to be creating more textboxes and I cannot seem to access them after creation. If I could dispose of them and recreate at each execution of the create_form function I think it would work out.

 Code:
Function Open_Item()
$j=$ListViewEx1.SelectedItem.Index
Create_Form($j)
If $ListViewEx1.SelectedItems.Count > 0
  $frmEdit.Text="Edit Selection ["+$Item.text+"]"
  $Form.enabled="False"  
  $frmEdit.center
  $frmEdit.show
 For Each $Item In $ListViewEx1.SelectedItems
   While $frmEdit.Visible And $frmEdit.Tag = 0
     $=Execute($FrmEdit.DoEvents)
    Loop
	If $frmEdit.Tag = 1 ; Save data back to ListViewEx1
     $frmEdit.Hide
     IF Not Instr($Form.text,"*") 
	  $Form.text = $Form.text + "*"
     EndIf
     Else ; Quit and return to main form
     $frmEdit.Hide
	 EndIf
  Next
EndIf
 $Form.enabled="True"  
 $frmEdit.Tag = 0
EndFunction 


Edited by Mart (2011-11-02 09:39 PM)
Edit Reason: Please use code tags when posting code.
_________________________
Dr Rick
Computer Specialist