Results 1 to 9 of 9

Thread: Error: The current row is not available.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    367

    Error: The current row is not available.

    I am using VB 6.0, ADO commands, and Access 2000.

    I am getting an error message saying...
    The current row is not available.

    This is how my form is set up.

    A user double click an employee from a datagrid.

    A second form appears with an SSTab. The first tab has textboxes, second tab has datagrid, and third tab has a datagrid. All of this information is related to the employee that was selected and populated correctly.

    My problem occurs when i select any cell on the first two columns of either of the two datagrids. After selected a cell on the first two columns of either of the two datagrids and I exit the form I get the error message I stated at the very beginning.

    If I select any of the other cells on the other columns or click anywhere on teh form or select anything else on the form and then try to exit I get no error message.

    It doesn't seem to be doing any damage to the data or anything, but I'd still like to get rid of that error message and if possible understand why it is coming up.

    Ok geniuses....do your thing! Cause my head is about here right now...

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    367

    Re: Error: The current row is not available.

    *bump*

    So, any ideas on what this error means?
    Or should I just make an error catch code?

  3. #3
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Error: The current row is not available.

    Are you using adodc as your datasource of your datagrids? How are you setting the recordsource?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    367

    Re: Error: The current row is not available.

    My data source is set using the following code...

    Set cnMath = New ADODB.Connection
    cnMath.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source = " & App.Path & "\Math.mdb"
    cnMath.Open

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Error: The current row is not available.

    What is the datasource of your datagrids? A recordset object? How are you populating the recordsets?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    367

    Re: Error: The current row is not available.

    Both datagrids are populated the same way, but I'll only post the coding for one of them to save space. Both datagrids display properly. Just that problem I said in my first post.

    VB Code:
    1. Dim strSQL As String 'variable to store SQL statement
    2.  
    3. strSQL = "SELECT tblStudent.fldStuLastName + ', ' + " & _
    4. "tblStudent.fldStuFirstName + ' ' + " & _
    5. "IIF(ISNULL(tblStudent.fldStuMiddleName), ' ', " & _
    6. "tblStudent.fldStuMiddleName), tblTutorHistory.fldTutorDate, " & _
    7. "tblTutorHistory.fldHoursTutored, tblTutorHistory.fldSubject FROM" & _
    8. " tblTutorHistory INNER JOIN tblStudent ON tblStudent.fldStuID =" & _
    9. " tblTutorHistory.fldStuID WHERE tblTutorHistory.fldEmpID = " & lblEmpID
    10.  
    11. Set rsTutorHistory = New ADODB.Recordset
    12.  
    13. rsTutorHistory.CursorLocation = adUseClient
    14.  
    15. rsTutorHistory.Open strSQL, Form2.cnMath, adOpenForwardOnly, adLockReadOnly, adCmdText
    16.  
    17. Set dgTutoringHistory.DataSource = rsTutorHistory

  7. #7
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Error: The current row is not available.

    Is the AllowUpdate property of your DataGrids ticked/selected?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    367

    Re: Error: The current row is not available.

    Quote Originally Posted by dee-u
    Is the AllowUpdate property of your DataGrids ticked/selected?
    The AllowUpdate properties for both datagrids are set to False.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    367

    Re: Error: The current row is not available.

    *bump* Any ideas?

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