Why don't you just bind the form to "tblItem"?

Originally Posted by
mcaliebe
Here is the simple code I am using. All the fields in the tables are set to text, <snip>
Really? You are sure that the data types of ALL of the fields are TEXT? Even the PK field "ID"?
Since text fields must be delimited, I wouldn't expect the SQL to execute at all.
If the fields are TEXT datatypes, I would expect the SQL to look like (note the single quotes)
Code:
Dim stSQL As String
stSQL = "UPDATE tblItem"
stSQL = stSQL & " SET tblItem.ItemNbr = '" & Me.txtItemNbr & "',"
stSQL = stSQL & " tblItem.BrennanItemNbr = '" & Me.txtBrennanItemNbr & "'"
stSQL = stSQL & " WHERE tblItem.ID = '" & Me.txtID & "';"
' DoCmd.RunSQL stSQL
Currentdb.Execute stSQL, dbFailOnError '<<-- I would use this
Add Debug statement to see what the SQL statement looks like and post the result from the immediate window:
Code:
Dim stSQL As String
stSQL = "UPDATE tblItem"
stSQL = stSQL & " SET tblItem.ItemNbr = '" & Me.txtItemNbr & "',"
stSQL = stSQL & " tblItem.BrennanItemNbr = '" & Me.txtBrennanItemNbr & "'"
stSQL = stSQL & " WHERE tblItem.ID = '" & Me.txtID & "';"
Debug.Print stSQL
Currentdb.Execute stSQL, dbFailOnError