Results 1 to 5 of 5

Thread: help me in open code

Threaded View

  1. #1

    Thread Starter
    Lively Member milen's Avatar
    Join Date
    May 2006
    Posts
    116

    Exclamation help me in open code

    this is the save code

    VB Code:
    1. Private Sub Command1_Click()
    2. CommonDialog1.ShowSave
    3. Dim frm As Form
    4.     Dim ctl As Control
    5.     Open (CommonDialog1.FileName) For Output As #1
    6.     For Each frm In Forms
    7.         For Each ctl In frm.Controls
    8.             If TypeOf ctl Is TextBox Or TypeOf ctl Is Label Then
    9.            
    10.                    Print #1, frm.Name & " : " & ctl.Name & " : " & ctl
    11. End If
    12.         Next
    13.     Next
    14.     Close #1
    15. End Sub
    16. -------------------
    17. my probleme is in the open code of this save code
    18. this is the code
    19. Private Sub Command2_Click()
    20. CommonDialog1.ShowOpen
    21. Dim colForms As Collection
    22.     Dim sParts() As String, sTemp As String, N As Long
    23.    
    24.     Set colForms = New Collection
    25.     For N = 0 To Forms.Count - 1
    26.         colForms.Add Forms(N), Forms(N).Name
    27.     Next N
    28.    
    29.     Open (CommonDialog1.FileName) For Input As #1
    30.         Do Until EOF(1)
    31.             Line Input #1, sTemp
    32.             sParts = Split(sTemp, " : ")
    33.             colForms(sParts(0)).Controls(sParts(1)) = sParts(2)
    34.         Loop
    35.     Close #1
    36.     Set colForms = Nothing
    37.     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
    Last edited by RobDog888; Jul 22nd, 2006 at 10:56 PM. Reason: Added [vbcode] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width