B
Bill Phillips
I am using a form to update inventory records. On the form I indicate the
inventory ticket # and the batch. The Ticket# uses a combo box for selection
and the batch uses another combo box. I then use the following code to go to
the appropriate record:
Set rs = Me.Recordset.Clone
lintRecountID = Me.cboBatch.Column(2)
rs.FindFirst "[RecountID] = " & lintRecountID
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
I enter an inventory count and update a timestamp field, click a command
button which performs a SQL update statement as follows:
strSQL = "Update tblRecountDetail" & _
" SET tblRecountDetail.InvReCount = " & lintTotCt & ",
tblRecountDetail.EntTimeStamp = #" & Now & "#, tblRecountDetail.EnterDt = #"
& Now & "#, tblRecountDetail.EnterTm = #" & Now & "# " & _
" WHERE (tblRecountDetail.TicketNo = " & rs1!TicketNo & "
AND tblRecountDetail.RectBatch = " & rs1!RectBatch & ")"
CurrentDb.Execute strSQL, dbFailOnError
The problem is that when I go back to the Ticket number combo box I recieve
the following error message:
The Data has been changed. Another user edited this record and saved the
changes before you attempted to save your changes. Re-edit the record.
I amusing Access 2007, but the db is in Access 2003 format. There are no
other users on this db, I am the only person working on the development side.
If I click OK on the error message, I can go back into the table that has
been updated and the information i added through the form has been updated.
Thanks,
inventory ticket # and the batch. The Ticket# uses a combo box for selection
and the batch uses another combo box. I then use the following code to go to
the appropriate record:
Set rs = Me.Recordset.Clone
lintRecountID = Me.cboBatch.Column(2)
rs.FindFirst "[RecountID] = " & lintRecountID
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
I enter an inventory count and update a timestamp field, click a command
button which performs a SQL update statement as follows:
strSQL = "Update tblRecountDetail" & _
" SET tblRecountDetail.InvReCount = " & lintTotCt & ",
tblRecountDetail.EntTimeStamp = #" & Now & "#, tblRecountDetail.EnterDt = #"
& Now & "#, tblRecountDetail.EnterTm = #" & Now & "# " & _
" WHERE (tblRecountDetail.TicketNo = " & rs1!TicketNo & "
AND tblRecountDetail.RectBatch = " & rs1!RectBatch & ")"
CurrentDb.Execute strSQL, dbFailOnError
The problem is that when I go back to the Ticket number combo box I recieve
the following error message:
The Data has been changed. Another user edited this record and saved the
changes before you attempted to save your changes. Re-edit the record.
I amusing Access 2007, but the db is in Access 2003 format. There are no
other users on this db, I am the only person working on the development side.
If I click OK on the error message, I can go back into the table that has
been updated and the information i added through the form has been updated.
Thanks,