Hi!
I have an several unbound boxes, that calculate the final price for an order. The first one gets the subtotal from the subform the second one discounts the reduction percentage, the third one adds the VAT and the last one gets the transport costs and adds them getting the total.
It's pretty simple. The 'totalctrl' gets inserted into a table with an update SQL in the VBA when you save the order.
the problem: although the 'totalctrl' shows the exact value when you try to save it into the table it only saves the transport costs instead of the total. I converted the totalctrl into a string and add it to the update but it doesn't work, any ideas why this might be happening? My code is:
Dim strSetTtl As String
Dim strTotal As String
Dim stLinkCriteria As String
stLinkCriteria = "[ProformaId] =" & Me![ProformaId]
strTotal = Me.ttlCtrl.Value
strSetTtl = "UPDATE Proformas " & _
"SET Proformas.[TOTAL] ='" & strTotal & "' " & _
"WHERE '" & stLinkCriteria & "' ;"
DoCmd.RunSQL strSetTtl
I have an several unbound boxes, that calculate the final price for an order. The first one gets the subtotal from the subform the second one discounts the reduction percentage, the third one adds the VAT and the last one gets the transport costs and adds them getting the total.
It's pretty simple. The 'totalctrl' gets inserted into a table with an update SQL in the VBA when you save the order.
the problem: although the 'totalctrl' shows the exact value when you try to save it into the table it only saves the transport costs instead of the total. I converted the totalctrl into a string and add it to the update but it doesn't work, any ideas why this might be happening? My code is:
Dim strSetTtl As String
Dim strTotal As String
Dim stLinkCriteria As String
stLinkCriteria = "[ProformaId] =" & Me![ProformaId]
strTotal = Me.ttlCtrl.Value
strSetTtl = "UPDATE Proformas " & _
"SET Proformas.[TOTAL] ='" & strTotal & "' " & _
"WHERE '" & stLinkCriteria & "' ;"
DoCmd.RunSQL strSetTtl