this is the save code
-------------------VB Code:
Private Sub Command1_Click() CommonDialog1.ShowSave Dim frm As Form Dim ctl As Control Open (CommonDialog1.FileName) For Output As #1 For Each frm In Forms For Each ctl In frm.Controls If TypeOf ctl Is TextBox Or TypeOf ctl Is Label Then Print #1, frm.Name & " : " & ctl.Name & " : " & ctl End If Next Next Close #1 End Sub ------------------- my probleme is in the open code of this save code this is the code Private Sub Command2_Click() CommonDialog1.ShowOpen Dim colForms As Collection Dim sParts() As String, sTemp As String, N As Long Set colForms = New Collection For N = 0 To Forms.Count - 1 colForms.Add Forms(N), Forms(N).Name Next N Open (CommonDialog1.FileName) For Input As #1 Do Until EOF(1) Line Input #1, sTemp sParts = Split(sTemp, " : ") colForms(sParts(0)).Controls(sParts(1)) = sParts(2) Loop Close #1 Set colForms = Nothing End Sub
when i click in f5 button in microsoft visual basic look to this error
colForms(sParts(0)).Controls(sParts(1)) = sParts(2)
help me please
![]()




Reply With Quote