Results 1 to 3 of 3

Thread: [RESOLVED] Error that says : Subscript out of range...

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2005
    Posts
    570

    Resolved [RESOLVED] Error that says : Subscript out of range...

    Hi,

    I am getting an error: "Subscript out of range" and highlights the following line:
    VB Code:
    1. dbgAutomobiles.Columns(i).Width = 0

    I have 47 fields in total.

    The following is the code:

    VB Code:
    1. Private Sub Datagridcolumns()
    2. Dim i As Integer
    3. dbgAutomobiles.Columns(0).Width = 0
    4. dbgAutomobiles.Columns(1).Width = 3025
    5. dbgAutomobiles.Columns(2).Width = 1000
    6. dbgAutomobiles.Columns(3).Width = 900
    7.  
    8. For i = 4 To dbgAutomobiles.Columns.Count
    9.         dbgAutomobiles.Columns(i).Width = 0
    10. Next
    11. End Sub

    Regards.

    Seema_s
    Last edited by seema_s; May 13th, 2006 at 09:59 AM.

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