Access splitting issue: Operation is not supported for this type of object

The code below worked fine until I split the database with the Database Splitter.  Now I get error 3251: 'Operation is not supported for this type of object'.  Help!

Private Sub cmdOpenMailingForm_Click()

' Opens form so a new mailing for the selected organisation can be added

On Error GoTo Err_cmdOpenMailingForm_Click

    Dim stDocName As String
    Dim stLinkCriteria As String
    Dim intCancel As Integer
   
    ' Check an organisation is selected
    If (Me!lstOrganisations = "" Or IsNull(Me!lstOrganisations)) Then
        MsgBox "Please choose an organisation", vbExclamation + vbOKOnly, conProgname
        Exit Sub
    Else
        Dim db As Database
        Dim rec As Recordset
       
        Set db = CurrentDb()
        Set rec = db.OpenRecordset("tblOrganisation")
       
        rec.Index = "OrganisationID"
        rec.Seek "=", Me.lstOrganisations
       
        ' If organisation isn't active throw up a message
        If rec("Active") = "False" Then
            MsgBox "This organisation is inactive." & vbCrLf & _
                "If you want to send items to it please make it active again.", vbExclamation + vbOKOnly, conProgname
        Exit Sub
        Else
            stLinkCriteria = "[OrganisationID]=" & Me![lstOrganisations]
            DoCmd.OpenForm "frmMailing", , , stLinkCriteria, acFormAdd ' Opens the form to add a mailing
            Forms!frmMailing!OrganisationID = Me![lstOrganisations]
           
            Forms!frmMailing!txtOrganisation = rec("OrgName")
           
            Set db = Nothing
            Set rec = Nothing
        End If
     End If

Exit_cmdOpenMailingForm_Click:
    Exit Sub

Err_cmdOpenMailingForm_Click:
    MsgBox Err.Description, vbExclamation + vbOKOnly, conProgname
    Resume Exit_cmdOpenMailingForm_Click
   
End Sub
LVL 1
looper8Asked:
Who is Participating?
 
GranModConnect With a Mentor Commented:
Closed, 500 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0
 
looper8Author Commented:
OK I've solved this one myself!  Turns out that the Seek operation only works on an unsplit database.  So by changing Set rec = db.OpenRecordset("tblOrganisation")
 to Set rec = db.OpenRecordset("SELECT * FROM tblOrganisation WHERE OrganisationID = " & lst.Organisations), and deleting the rec.Index and rec.Seek lines all becomes well!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.