T
Ted
Good morning all, I was wondering if someone could give me a quick tip. How
do i make a recordset allow edits? Its telling me "Update or CancelUpdate
without AddNew or Edit." I know its got to be something simple that i'm
missing...rst.edit?? Any help would be very much appreciated.
Dim strCancReason As String
Dim i As Integer
Dim n As Long
Dim strSQL As String
Dim rst As Recordset
Dim dbs As Database
Set dbs = CurrentDb
strSQL = "SELECT ALLCOMPANIESDATA.* FROM ALLCOMPANIESDATA WHERE
(((ALLCOMPANIESDATA.TRANSCD)='04'))"
Set rst = dbs.OpenRecordset(strSQL)
rst.MoveLast
rst.MoveFirst
For n = 1 To rst.RecordCount
i = 0
Do Until strCancReason Like "(*)"
strCancReason = Right(rst![NAME], i + 1)
i = i + 1
Loop
rst![CANCREASON] = Mid(strCancReason, 2, Len(strCancReason) - 2)
strCancReason = ""
DoCmd.GoToRecord , , acNext
Next n
DoCmd.SetWarnings True
TIA
Ted
do i make a recordset allow edits? Its telling me "Update or CancelUpdate
without AddNew or Edit." I know its got to be something simple that i'm
missing...rst.edit?? Any help would be very much appreciated.
Dim strCancReason As String
Dim i As Integer
Dim n As Long
Dim strSQL As String
Dim rst As Recordset
Dim dbs As Database
Set dbs = CurrentDb
strSQL = "SELECT ALLCOMPANIESDATA.* FROM ALLCOMPANIESDATA WHERE
(((ALLCOMPANIESDATA.TRANSCD)='04'))"
Set rst = dbs.OpenRecordset(strSQL)
rst.MoveLast
rst.MoveFirst
For n = 1 To rst.RecordCount
i = 0
Do Until strCancReason Like "(*)"
strCancReason = Right(rst![NAME], i + 1)
i = i + 1
Loop
rst![CANCREASON] = Mid(strCancReason, 2, Len(strCancReason) - 2)
strCancReason = ""
DoCmd.GoToRecord , , acNext
Next n
DoCmd.SetWarnings True
TIA
Ted