Results 1 to 6 of 6

Thread: [Solved] Run-time Error regarding BOF or EOF

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    103

    Resolved [Solved] Run-time Error regarding BOF or EOF

    When I open the "New Customer Maintenance" form (where I could fill out the fields so that they get updated on the datagrid) I get this errror:

    Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

    Here's the code:

    VB Code:
    1. Private Sub LoadData()
    2.    
    3.     Dim psql As String
    4.     Set cnn = New ADODB.Connection
    5.    
    6.     cnn.Mode = adModeReadWrite
    7.    
    8.     cnn.Open ("INVENTORY")
    9.  
    10.    
    11.     Set rec = New ADODB.Recordset
    12.    
    13.     rec.CursorType = adOpenKeyset
    14.     rec.LockType = adLockOptimistic
    15.    
    16.    
    17.    
    18.     psql = "select * from tblCustomerInformation "
    19.     psql = psql + " where CustNo = " + Trim(Str(Id))
    20.    
    21.    
    22.     rec.Open psql, cnn, , , 1
    23.  
    24.     *Text2.Text = IIf(IsNull(rec!Fname), "", rec!Fname)
    25.     Text1.Text = IIf(IsNull(rec!Lname), "", rec!Lname)
    26.     Text5.Text = IIf(IsNull(rec!ContactNo), "", rec!ContactNo)
    27.     Text8.Text = IIf(IsNull(rec!EmailAdd), "", rec!EmailAdd)
    28.     Text14.Text = IIf(IsNull(rec!Birthday), "", rec!Birthday)
    29.     'Text9.Text = IIf(IsNull(rec!Gender), "", rec!Gender)
    30.     Text9.Text = IIf(IsNull(rec!Address), "", rec!Address)
    31.     Text13.Text = IIf(IsNull(rec!Comment), "", rec!Comment)
    32.    
    33.  
    34. End Sub

    The line with the asterisk is highlighted when debugged.
    Last edited by sirkeled; Sep 3rd, 2006 at 04:28 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