Error '3075'

luzz

Registered User.
Local time
Today, 14:10
Joined
Aug 23, 2017
Messages
346
Hello guys,

I am facing syntax error (missing operator) in query expression 'PONumber = '.

This error keep pop up after i added the POnumber in? Anyone has any idea on how to solve this?

I have paste my code with error below:

'otherwise ( Tag of txtID store the id of student to be modified)
CurrentDb.Execute "UPDATE mxd " & _
" SET PONumber = " & Me.txtPONumber & _
", Content = '" & Me.txtContent & "'" & _
", Reference = '" & Me.txtReference & "'" & _
", Fabrication = '" & Me.txtFabrication & "'" & _
", Width = '" & Me.txtWidth & "'" & _
", FinishedGoods = '" & Me.txtFinishedGood & "'" & _
", Colour = '" & Me.txtColour & "'" & _
", LabDipCode = '" & Me.txtLabCode & "'" & _
", GrossWeight = '" & Me.txtGrossweight & "'" & _
", NettWeight = '" & Me.txtNettweight & "'" & _
", LBS = '" & Me.txtLbs & "'" & _
", Loss = '" & Me.txtLoss & "'" & _
", Yds = '" & Me.txtYds & "'" & _
", Remarks = '" & Me.txtRemarks & "'" & _
" WHERE PONumber = " & Me.txtPONumber.Tag

End If

'clear form
cmdClear_Click
'refresh data in list on form
FormSub.Form.Requery

End Sub
 
I assume the PONumber.Tag is text in the Where clause?
If so it needs escaping with single quotes like the rest of your text fields.
 
I assume the PONumber.Tag is text in the Where clause?
If so it needs escaping with single quotes like the rest of your text fields.

My PONumber is integer
 
What about the tag property - as far as I know that is always a string?
 
Actually having read this a bit more carefully, this update query appears to make no sense unless this is an unbound form.

If this is a bound form your are updating the current record with it's own current values. Which is completely pointless.
 

Users who are viewing this thread

Back
Top Bottom