Results 1 to 4 of 4
  1. #1
    yamie is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    2

    Button Coding

    Hi Guys
    I am new to access programming and stuff I need some help, I have a form created from a table, the form has two text boxes that user will fill in figures which I want when command button is clicked they must add and result displayed at the same time updating actual table.


    So far the code I wrote behind the command button never yielded anything.
    please help
    Yamie

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    It is rarely a good idea to store calculated results in a table.

  3. #3
    yamie is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    2

    Button Coding

    RuralGuy

    I know it may sound weird but it is a straight idea, I assume the calculation will only be on form text boxes and that data will save into table as any form entry, just wanna know how to code the textbox1 +textbox2 and have sum displayed.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,923
    The ControlSource of TextBox3 cound be set to:
    =Nz(Me.TextBox1,0)+Nz(Me.TextBox2,0)
    ...to get the calculation to display but it will not save in the RecordSource. You could also do basically the same thing in the RecordSource query and get the result by binding TextBox3 to the calculated field.

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

Similar Threads

  1. Adding VB code on a embedded coding for a button
    By cwwaicw311 in forum Programming
    Replies: 1
    Last Post: 02-20-2010, 12:25 PM
  2. VB coding for saving when click on save button in form
    By cwwaicw311 in forum Programming
    Replies: 1
    Last Post: 02-04-2010, 11:11 PM
  3. simple math coding for form field??
    By RCBNewbee in forum Programming
    Replies: 7
    Last Post: 07-13-2009, 08:30 AM
  4. Bar-Coding
    By texasprincess7 in forum Access
    Replies: 1
    Last Post: 02-12-2009, 10:29 AM
  5. parsing data in access (coding?)
    By banker247 in forum Programming
    Replies: 0
    Last Post: 01-13-2009, 12:05 PM

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