Results 1 to 2 of 2
  1. #1
    DB2010MN26 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    37

    Simply Multiplication on SubForm field using VBA

    Have a subform that I use to edit my Trade ticket table. I want my Total Cost field to update to (Units * Price) + Commision on the After Update event for my Units, Price and Commision fields. Heres my code:



    Private Sub Units_AfterUpdate()
    Total Cost = (Price * Units) + Commision
    End Sub


    I get the following error;

    Compile Error: Sub or function not defined.


    I'm very new to using VBA in access so I'm sure its something very simple my missing. Please advise....

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Presuming those are all field names, the inadvisable space would require the first one to be bracketed.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 11-16-2011, 07:30 PM
  2. Multiplication of txt box to table field
    By veereshrk in forum Programming
    Replies: 3
    Last Post: 10-01-2011, 05:57 AM
  3. Replies: 7
    Last Post: 07-15-2011, 01:58 PM
  4. Replies: 9
    Last Post: 12-15-2010, 01:44 PM
  5. simple multiplication question
    By aaronmarsh632 in forum Access
    Replies: 1
    Last Post: 10-08-2009, 04:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums