Hi there everyone, hope you are well.
I am trying to get my head around something, I am the first to admit I am not the best with VBA or Access SQL so please forgive me if this is a stupid question.
I am trying to update a field with the result of what is in the field plus the contents of a unbound form field.
So if crm_order_det.Qty contained the number 5 and the form field (labelled qty) contained 7 I would like the field crm_order_det.Qty to end up with 12.
the code I am using
However I get the following error
Run-time error '424': Object required.
Could anyone please help as I have been struggling with this for the last 24hrs.
Thanks in advance!
I am trying to get my head around something, I am the first to admit I am not the best with VBA or Access SQL so please forgive me if this is a stupid question.
I am trying to update a field with the result of what is in the field plus the contents of a unbound form field.
So if crm_order_det.Qty contained the number 5 and the form field (labelled qty) contained 7 I would like the field crm_order_det.Qty to end up with 12.
the code I am using
Code:
sql = " Update crm_order_det SET [Qty] = (" & _
frm!Qty + crm_order_det.Qty & ") where crm_order_det.part = '" & frm![SearchResults] & _
"' and order_id = " & frm![order_id] & ";"
DoCmd.RunSQL sql
However I get the following error
Run-time error '424': Object required.
Could anyone please help as I have been struggling with this for the last 24hrs.
Thanks in advance!