[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

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
        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
            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 Sub

    MsgBox Err.Description, vbExclamation + vbOKOnly, conProgname
    Resume Exit_cmdOpenMailingForm_Click
End Sub
1 Solution
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!
Closed, 500 points refunded.
The Experts Exchange
Community Support Moderator of all Ages

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now