David_W_R
asked on
How to determine if a recordset is updatable
At the end of a procedure in which I rs.edit, when I close the rs, I need to know whether the rs has been written to, in order to determine whether to rs.update or not. Otherwise, rs.update throws an error if the rs has not been altered. Is there a test that determines this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<< when I close the rs, I need to know whether the rs has been written to, in order to determine whether to rs.update or not.>>
Are you trying to update after closing the recordset?
rs.close should come after the rs.Update.
Are you trying to update after closing the recordset?
rs.close should come after the rs.Update.
Yes ... let me add the Close:
With CurrentDb.OpenRecordset("S omeDataSou rce", dbOpenDynaset)
If .Updatable = False Then
MsgBox " sorry no can do"
Exit Function
End If
.Edit
' set values here
.Update ' data is Written here.
.Close ' **********
End With
With CurrentDb.OpenRecordset("S
If .Updatable = False Then
MsgBox " sorry no can do"
Exit Function
End If
.Edit
' set values here
.Update ' data is Written here.
.Close ' **********
End With
ASKER
Lots of help from both experts combined for a very effective solution. Thanks for the quick response!
What error are you getting and can you post the relevant code?
mx