Results 1 to 16 of 16

Thread: [RESOLVED] Object Variable or Block Variable not set Error

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    8

    [RESOLVED] Object Variable or Block Variable not set Error

    Hello... I'm trying to write a simple program for a class to pull data from a table and write it to a random file.. or text file.. but i keep getting that stupid error message "Object Variable or Block Variable not set" Here is my Code..
    VB Code:
    1. Option Explicit
    2. Private Type Customer
    3.     CNumber As String
    4.     FName As String
    5.     LName As String
    6.     Address As String
    7.     City As String
    8.     State As String
    9.     Zip As Integer
    10. End Type
    11.  
    12.  
    13. Private Sub Form_Load()
    14.  
    15. Dim x As Integer
    16.  
    17. Dim Cust(4) As Customer
    18.     Do While Not DataC1.Recordset.EOF
    19.         Cust(x).FName = DataC1.Recordset!FName
    20.         Cust(x).LName = DataC1.Recordset!LName
    21.         Cust(x).Address = DataC1.Recordset!Address
    22.         Cust(x).City = DataC1.Recordset!City
    23.         Cust(x).State = DataC1.Recordset!State
    24.         Cust(x).Zip = DataC1.Recordset!Zip
    25.         Cust(x).CNumber = DataC1.Recordset!CNumber
    26.         DataC1.Recordset.MoveNext
    27.         x = x + 1
    28.     Loop
    29.  
    30. Put #1, , Cust
    31.    
    32. End Sub
    Last edited by VB.Newb; Feb 13th, 2006 at 02:09 PM.

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