Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Posts
    3

    Smile Calculation field in form

    Can somebody please help me, I'm relatively new to MS Access

    I have attached the db i need help with

    There are two tables and two forms linked to those tables

    The issue that im having is that i can't seem to get the fields to calculate within the form. The change box for each question in the form should equal Post Score - Pre Score. I have tried everything and can not seem to do it



    Please help

  2. #2
    rommelgenlight is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    77
    since your textbox "change" are bound to change_question control source you maybe in difficulty using (=[post_question1]-[pre_question1]) in your default value of the textbox. what you can probably do is use the EVENT PROCEDURE like AFTERUPDATE or LOSTFOCUS.

    If you use after update event procedure it goes something like this:

    a. Using the Pre_Question1 textbox:

    Private Sub Pre_Question1_AfterUpdate()
    me.Change_Question1.Value=me.Post_Question1.Value-me.Pre_Question1.value
    me.overall_change.value=me.change_question1.value+ me.change_question2.value+so on and so forth.
    End Sub

    b. Using the Post_Question1 textbox:
    Private Sub Post_Question1_AfterUpdate()
    Me.Change_Question1.Value = Me.Post_Question1.Value - Me.Pre_Question1.Value
    me.overall_change.value=me.change_question1.value+ me.change_question2.value+so on and so forth.
    End Sub

    study how it works. this is just a simple way for you as a beginner. as you go on you can also study how to use DIM statement. research for it.

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

Similar Threads

  1. form - subform field mapping
    By nqirar in forum Programming
    Replies: 2
    Last Post: 03-02-2009, 01:49 PM
  2. Updating Table field from Form
    By Kunuk in forum Access
    Replies: 0
    Last Post: 02-26-2009, 11:41 PM
  3. In a field on a Form, on click open another form
    By jackieagra in forum Programming
    Replies: 1
    Last Post: 03-20-2008, 09:44 AM
  4. Problems with autonumber field in a form
    By admaldo in forum Forms
    Replies: 0
    Last Post: 02-25-2008, 11:09 AM
  5. Subform vs main form calculation
    By fadone in forum Forms
    Replies: 17
    Last Post: 12-21-2005, 07:27 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