Here is my question: can I use a Long Text field in an update query and if so, how? - thank you for any help.
I have included my function containing the update query. It blows up on execute with the following error.
Error: 3075
Syntax error (missing operator) in query expression '<div>... Test Text...</div>'
The 'str' data type (below) is a Long Text data type with Text Format set to Rich Text.
Code:
Public Function setReasonSelected(cRecordId As Long, _
pRecordId As Long, _
vBidId As Long, _
str As String) As Boolean
'update all vendor items with the same 'reason selected' as the passed-in str
'
'this update will only work if the vendor's item is selected
'
On Error GoTo setError
Dim db As DAO.Database
Dim strSQL As String
Set db = CurrentDb
strSQL = "UPDATE tblVendorBidPrices SET reasonSelected = " & str & _
" WHERE cRecordId = " & cRecordId & _
" AND pRecordId <> " & pRecordId & _
" AND vBidId = " & vBidId & _
" AND selected = True"
db.Execute strSQL, dbFailOnError
setReasonSelected = True 'set return value
exitHere:
'housekeeping
db.Close
Set db = Nothing
Exit Function
setError:
MsgBox "Unable to update 'Reason Selected' for record ID: " + CStr(pRecordId) + vbCrLf + vbCrLf + _
"Error: " + CStr(Err.Number) + vbCrLf + Err.Description
setReasonSelected = False 'set return value
Resume exitHere
End Function