Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The recordset is not updatable

Status
Not open for further replies.
Jan 4, 2005
3
US
We have an Access DB that worked perfectly fine in Access 2003 that uses a form to pull data from a table. When the record is returned, the user had the ability to edit the data and save back to the table. When opened in Access 2007 and the user tries to edit a field in the form an error message is returned as saying, "This recordset is not updatable". How do we get around this issue...and what changed from 2003 to 2007 to make this suddenly a problem...ANY help would be GREATLY appreciated.
 
Have you tried saving the database in Access 2007 format (.accdb) then re-opening it?
 
Yes, we have tried that and still no success. We are starting to think that it's the backend coding that Access 2007 doesn't like - Please see coding below to see if anything stands out:

Private Sub ComboBoxAFEID_AfterUpdate()
'
On Error GoTo ErrorHandler

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim ctlCombo As Control

Set cn = CurrentProject.AccessConnection ' Use the ADO connection that Access uses
'
'Create an instance of the ADO Recordset class, and set its properties
'
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "SELECT * FROM IBMImportData"
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.CursorLocation = adUseServer
.Open
End With

Set ctlCombo = Forms!IBMImportData!ComboBoxAFEID 'Return Control object pointing to a combo box

Set Me.Recordset = rs 'Set the form's Recordset property to the ADO recordset
'
rs.MoveFirst
rs.Find "IBMAFE = " & Me.ComboBoxAFEID
Me.Bookmark = rs.Bookmark
rs.Close

ctlCombo.Requery ' Requery source of data for list box

Exit Sub ' Exit to avoid handler
'
ErrorHandler: ' Error-handling routine.

MsgBox "No Matching Record Found!"
rs.Close
DoCmd.Close acForm, Me.FormName


End Sub
 

I'm not really that familiar with ADODB, but one thing you should do is set a debugging breakpoint close to the beginning of this procedure you have provided code for (let's say on the line "Set cn= * * *"). Then, when the application hits the breakpoint, step through the code line by line until you hit the line that gives you the error. Then we'll have a better idea exactly what statement it has a problem with.

To set a breakpoint, place the cursor on the line you want to stop at, then go to Debug > Toggle Breakpoint. To step through the code after hitting the breakpoint, use Debug > Step Into or just keep hitting F8 until you come up with the error.
 
We appreciate your help we have gone ahead and created a new form and used the applyfilter method on a combobox to replace the code above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top