Consulting

Results 1 to 3 of 3

Thread: sum txtbox to set value not working

  1. #1
    VBAX Regular
    Joined
    Sep 2005
    Posts
    44
    Location

    sum txtbox to set value not working

    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:

    [VBA]
    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
    [/VBA]

  2. #2
    VBAX Regular
    Joined
    Sep 2005
    Posts
    44
    Location
    anyone has any ideas, pleasee?

  3. #3
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,297
    Location
    Are you talking on a Form or Report?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •