PDA

View Full Version : sum txtbox to set value not working



ailyn
12-09-2005, 02:46 AM
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 Currency
Dim stLinkCriteria As String
stLinkCriteria = "[ProformaId] =" & Me.ProformaId.Value & ""
strTotal = Me.ttlCtrl.Value
strSetTtl = "UPDATE Proformas " & _
"SET Proformas.[TOTAL] = " & strTotal & " " & _
"WHERE " & stLinkCriteria & " ;"
DoCmd.RunSQL strSetTtl

ailyn
12-12-2005, 02:11 AM
anyone has any ideas, pleasee?

OBP
12-18-2005, 03:50 AM
Are you talking on a Form or Report?