SQL Database - Update (PLEASE HELP!!!!!)

T

TheNovice

I have a form that is doing an update to a stop field. it has worked in the
past and I nothing has changed up until today? it tells me that he table is
being updated simultaniously and it cannot complete the process.

*** I created a view in the SQL database just to update the individual
fields that have 0 (zero) and this tells me that the fields is read only.

here is a copy of the code.

Public Sub main()

Dim LID As String
Dim strStop As Integer
Dim dblLstLID As Double
Dim db As Database
Dim rs As Recordset

Set db = CurrentDb()
'Set rs = db.OpenRecordset("dbo_vwPR_Stop_Det")
Set rs = db.OpenRecordset("dbo_tmpPR_Stop_Det", dbOpenDynaset)
With rs
strStop = 0


Do Until .EOF

' Check for change of Key

If LID <> !ACTV_EXTRAC_ACTV_LID Then
strStop = 1
dblLstLID = !ACTV_LID
LID = !ACTV_EXTRAC_ACTV_LID

End If

' Add stop numbers

.Edit
If !StopNum = 0 Then
If !ACTV_LID <> dblLstLID Then strStop = strStop + 1
!StopNum = strStop
End If
strLstCall = !PR_MS
dblLstLID = !ACTV_LID
.Update
.MoveNext
Loop

End With

rs.Close
db.Close

End Sub

Private Sub Form_Load()
main
End Sub

Private Sub Form_Open(Cancel As Integer)
main
End Sub
 

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