Jeremiah31
Programmer
I have a form called frmRTVEditSkuDescription with three unbound controls called
cboSkuSearch
txtSku
txtdescription
I’m using an SQL statement to populate txtSku and txtdescription based on criteria selected in the cboSkuSearch control. Search works fine. The problem is if I change the value in txtdescription, the update statement (below) won’t reflect the change value. Can someone please help me?
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
Dim strSQL As String
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
strSQL = "UPDATE tblSku SET txtSku = '" & Replace(Me.txtSKU, "'", "''") & "'" _
& ", txtdescription = '" & Replace(Me.txtDescription, "'", "''") & "'" _
& " WHERE 'cboskuSearch' = '" & Me.txtSKU & "'"
CurrentDb.Execute strSQL, dbFailOnError
MsgBox strSQL
MsgBox "Changes made to Sku " & UCase(Me!cboSkuSearch) & " have been saved."
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub
cboSkuSearch
txtSku
txtdescription
I’m using an SQL statement to populate txtSku and txtdescription based on criteria selected in the cboSkuSearch control. Search works fine. The problem is if I change the value in txtdescription, the update statement (below) won’t reflect the change value. Can someone please help me?
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
Dim strSQL As String
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
strSQL = "UPDATE tblSku SET txtSku = '" & Replace(Me.txtSKU, "'", "''") & "'" _
& ", txtdescription = '" & Replace(Me.txtDescription, "'", "''") & "'" _
& " WHERE 'cboskuSearch' = '" & Me.txtSKU & "'"
CurrentDb.Execute strSQL, dbFailOnError
MsgBox strSQL
MsgBox "Changes made to Sku " & UCase(Me!cboSkuSearch) & " have been saved."
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub