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

Posted on 2006-05-04
Last Modified: 2008-03-10
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
Question by:looper8
    LVL 1

    Author Comment

    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!

    Accepted Solution

    Closed, 500 points refunded.
    The Experts Exchange
    Community Support Moderator of all Ages

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Introduced in Microsoft SQL Server 2005, the Copy Database Wizard ( is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    Via a live example, show how to shrink a transaction log file down to a reasonable size.
    Viewers will learn how the fundamental information of how to create a table.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now