Results 1 to 3 of 3
  1. #1
    mosto is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jul 2016
    Posts
    2

    Updating table with an unbound form field

    Hi, I'm sure this is very simple, but I can't figure it out. I'm creating a database to generate weight dockets. The table 'Dockets' contains the following fields 'Gross', 'Tare'. I've created an AutoForm from the table, but to get the 'Nett' field on the form to calculate, I've unbound it from the 'Nett' field in the table and entered the expression =[Gross]-[Tare] as the Control Source, but this does not update the table with the correct figure in 'Nett', I'm assuming because it's unbound.



    So my question is how do I get the 'Nett' field in the table 'Dockets' to update when the Gross and Tare is entered in the corresponding Form?

    Thank in advance.

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    In your form, assuming the name of the Nett textbox is txtNett, add this code to the form's current event:

    txtNett = Gross - Tare

    Many developers avoid keeping calculated fields in tables. The value can be easily calculated in a query as needed.

  3. #3
    mosto is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jul 2016
    Posts
    2
    Much appreciated. Sorry, fairly new to using access from a development point of view, learning as I go. I've gone down the query route you mentioned, makes much more sense.

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

Similar Threads

  1. Replies: 5
    Last Post: 02-13-2015, 07:24 PM
  2. Replies: 5
    Last Post: 02-12-2014, 11:52 PM
  3. Two unbound boxes not updating in table
    By DeathByData in forum Access
    Replies: 29
    Last Post: 05-22-2013, 12:51 PM
  4. Replies: 4
    Last Post: 05-30-2011, 08:20 PM
  5. Updating Table field from Form
    By Kunuk in forum Access
    Replies: 0
    Last Post: 02-26-2009, 11:41 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