Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Invalid Operation Reserved Error -2147217867

Discussion in 'Information Technology' started by swedbera, Jul 28, 2006.

  1. swedbera

    Expand Collapse

    I have used the following successfully in the past. I have not used it in a
    couple of months and now it hangs up on the rs.open line and I can't seem to
    figure out why. I've tried changing the code and nothing is working for me.
    I get rid of one error and get a new error. This is my original code that
    did work at one time. I'm sure that something else in the database has
    changed over the past months, but what exactly that would have caused this
    not to work, I can't figure out.

    Can someone help - please!


    Dim rs As New ADODB.Recordset
    Dim bRSOpened As Boolean
    Dim Cnn As ADODB.Connection
    Dim bCnnOpened As Boolean
    Dim msg As String, varNumber As Variant

    bRSOpened = False
    bCnnOpened = False

    If IsNull(Me.cboCurrentSupId) Or IsNull(Me.cboNewSupID) Then
    msg = "You must select a current Supervisor"
    msg = msg & " and another Supervisor you want"
    msg = msg & " to reassign Employees to."
    MsgBox msg, vbInformation, "Reassign Supervisor"
    End If

    If Me.lstEmployees.ItemsSelected.Count = 0 Then
    MsgBox "You must select as least one Employee to reassign.",
    Exit Sub
    End If

    Set Cnn = CurrentProject.Connection
    rs.Index = "PrimaryKey"
    rs.Open "tblEmployee", Cnn, adOpenStatic, adLockOptimistic,
    bRSOpened = True
    bCnnOpened = True

    'Set up the For Each loop throught the collection
    For Each varNumber In Me.lstEmployees.ItemsSelected
    rs.Seek Me.lstEmployees.ItemData(varNumber), adSeekFirstEQ
    rs!SupID = Me.cboNewSupID

    Me.cboCurrentSupId = Me.cboNewSupID
    Me.cboNewSupID = Null

    stSQL = "SELECT tblEmployee.EmpID, tblEmployee.Employee,
    qlkp_Supervisors.Supervisor, qlkp_Managers.Manager FROM (tblEmployee LEFT
    JOIN qlkp_Supervisors ON tblEmployee.SupID = qlkp_Supervisors.SupId) LEFT
    JOIN qlkp_Managers ON tblEmployee.MgrID = qlkp_Managers.MgrID WHERE
    qlkp_Supervisors.supid = '" & Me.cboCurrentSupId & "' ORDER BY
    Me.lstEmployees.RowSource = stSQL


    bRSOpened = False
    bCnnOpened = False
    Set Cnn = Nothing
  2. Loading...

    Similar Threads Forum Date
    Sikh News Sikh Rendered Invalid In ’84 Riots Seeks Justice (Gulf Times) Breaking News Mar 14, 2008
    Sikh News 23 Years Later, Invalid Sikh Seeks Justice (Calcutta News) Breaking News Mar 13, 2008
    Sikh News 23 Years Later, Invalid Sikh Seeks Justice (New Kerala) Breaking News Mar 13, 2008
    Sikh News 23 Years Later, Invalid Sikh Seeks Justice (Hindustan Times) Breaking News Mar 13, 2008
    1984 Sikhs Demand Declassification Of Documents Related To Operation Bluestar History of Sikhism Jun 3, 2014

Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     

Share This Page