Field cannot be updated

N

Nexus

I keep seeming to have this error : "Field cannot be
updated" under my command button click event. Not too
sure which field they are referring to.

Private Sub cmdToolTransact_Click()
Dim strToolID As String, intCurrentInvLevel As Integer

strToolID = lstGetToolDetail
intCurrentInvLevel = txtInventoryLevel
Select Case lstTransactionType
Case "Tool Issue"
InventoryLevel = intCurrentInvLevel -
txtTransactionQty
Case "Tool Return"
InventoryLevel = intCurrentInvLevel +
txtTransactionQty
Case "Lost Tool"
InventoryLevel = intCurrentInvLevel -
txtTransactionQty
Case "Damaged Tool"
InventoryLevel = intCurrentInvLevel -
txtTransactionQty
Case "Tool Returned after Rework"
InventoryLevel = intCurrentInvLevel +
txtTransactionQty
Case "Receipt of Purchased Tool"
InventoryLevel = intCurrentInvLevel +
txtTransactionQty
End Select

DoCmd.Requery "txtInventoryLevel"
End Sub
 
K

Ken Snell

Your info isn't specific, but I'm guessing that InventoryLevel is a field in
the form's recordsource?

Is the form based on a query? Is the query updatable? In order for a query
to be updatable, a number of things must be present in
(or absent from) the query. See these MS Knowledge Base articles for more
info about updatable queries:

ACC2000: Cannot Edit or Update Record on a Form
http://support.microsoft.com/default.aspx?scid=kb;en-us;209571&Product=acc

ACC2000: Status Bar Displays "Recordset Not Updateable" Message When You Try
to Update a Linked Table
http://support.microsoft.com/default.aspx?scid=kb;en-us;304179&Product=acc

INFO: Troubleshooting Errors That May Occur When You Update Data in Queries
and in Forms
http://support.microsoft.com/default.aspx?scid=kb;en-us;328828&Product=acc

ACC: Update Query Based on Totals Query Fails
http://support.microsoft.com/default.aspx?scid=kb;en-us;116142&Product=acc
 
N

Nexus

InventoryLevel is a field name in one of the tables that
I have. Yes, the form is based on a query and the it is
updateable.
 
K

Ken Snell

Post the SQL of the form's recordsource if it's a query. Else post the info
re: the table that is the form's recordsource. What is the format of the
InventoryLevel field? (or is it a calculated field in a query?)

Do you have a control also named InventoryLevel on the form? Is that control
bound to the field InventoryLevel?
 
N

Nexus

Here's the SQL statement(Record source)of the form:

SELECT tblToolDetail.ToolCategoryID,
tblToolInventory.ToolID, tblToolDetail.ToolName,
tblToolDetail.RemarksToolDetail,
tblToolDetail.ToolDetailPicture,
tblToolInventory.InventoryLevel,
tblToolInventory.LastUpdate,
tblToolInventory.LastTransactionID,
tblToolInventory.LastTransactionType,
tblEmployees.FirstName
FROM tblToolDetail INNER JOIN (tblEmployees INNER JOIN
tblToolInventory ON tblEmployees.EmployeeID =
tblToolInventory.LastTransactionEmployeeID) ON
tblToolDetail.ToolID = tblToolInventory.ToolID
WHERE (((tblToolDetail.ToolCategoryID)=[Forms]!
[frmViewEditTools]![cmbGetToolCategory]) AND
((tblToolInventory.ToolID)=[Forms]![frmViewEditTools]!
[lstGetToolDetail]));

The format of InventoryLevel is a long integer. No, there
are no controls on the form named InventoryLevel.
 
K

Ken Snell

I don't see anything obviously wrong here.

If you'd like, zip up an example of the database with appropriate data and
email to me (remove "this is not real" from my reply email address) and I'll
take a look as time permits.
 

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