Works in Access 2007 but not in Access 2003


Joined
Apr 11, 2009
Messages
1
Reaction score
0
Help! I have built an app that works fine in Access 2007 but fails with a mysterious "Update or CancelUpdate without AddNew or Edit" error message in Access 2000/2003. All suggestions greatfully received...

I have built a much reduced toy app to show the problem. This has a form (named "Main") which contains a tab control with two tabs.

The first tab contains just one subform (named "Items"). This subform is a standard (wizard-created) form for viewing the records from a table. I also dropped onto that sub-form an unbound listbox that shows the name field for each record in the table, to let people quickly find the record they want. The code for this listbox looks like this:

Code:
Private Sub listItems_AfterUpdate()
    SelectRecord listItems.Value
End Sub

Public Function SelectRecord(id As Integer)
    Me.RecordsetClone.FindFirst "id=" & id
    If Not Me.RecordsetClone.NoMatch Then
        Me.Bookmark = Me.RecordsetClone.Bookmark
        Me.listItems.Selected(Me.RecordsetClone.AbsolutePosition) = True ' not necessary yet, but read on...
    End If
End Function
This all works perfectly fine.

In the second tab, there's just one unbound listbox, also showing the name field for each record in the table. The idea is that double clicking one of these takes you to the first tab with the clicked record selected (this makes more sense in the context of the complete application!). The code for this looks like this:

Code:
Private Sub otherList_DblClick(Cancel As Integer)
    Forms!Main.tabs.Value = 0 ' select the main tab
    Form_Items.SelectRecord otherList.Value
End Sub
In Access 2007, this also works perfectly.

But, in Access 2000/2003,
1. Bring up the main form
2. Immediately select the other tab
3. Double click to get pinged back to the first tab
4. It appears to work - the correct things are displayed and selected - but now any attempt to click on anything and you get the dreaded "Update or CancelUpdate without AddNew or Edit".

What's even wierder is that if you click on the listbox in the first tab before going to the other tab, then it all works fine even in 2000/2003.

Sorry for the long post, but I wasn't sure which details are relevant. I'm at my wit's end here - any ideas anyone?

-- Dave
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top