Reading data from Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scapistr00
    New Member
    • Oct 2006
    • 1

    Reading data from Access

    Access landed on my desk late last week at work, and I was told to try and make it work for us. We currently use Excel to store our data, which is a bit cumbersome. But it does allow us to make simple calculations in the data base. I was wondering how to pull values from fields so that some calculations may be made with the data and sent to another field.

    I'm attempting to sum 7 fields (CaMass1, CaMass2...) and have them sumed to CaTotal.

    Any help would be nice. Thanks
  • Starasoris
    New Member
    • Oct 2006
    • 11

    #2
    For the purposes of niceness, I suggest that you use a form in datasheet mode. That is if you want it to look like a spreadsheet and have calculated fields.
    You can just set the datasource of the form to the table holding the data and then add all the fields from the field list, into the detail section of the form. Set the forms mode to datasheet and it should give you the data.

    To add the calculated fields, drop on a text box (in design mode) and set it's control source to =field1+field2+ field3 (including the = sign) this should sort it out.

    An option is to put the calculated field in the table but I think that it is generally best to stay away from making the tables too smart with lookups etc in them as this can lead to confusion on what the actual data is.

    Good luck.

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Open a query in design view and then change the view to sql and paste in the following code (change TableName to your table name). Then save and run this query and see if it gives you the results you want.

      SELECT Sum([CaMass1]) AS SumCM1, Sum([CaMass]) As SumCM2, Sum([CaMass3]) As SumCM3, Sum([CaMass4]) As SumCM4, Sum([CaMass5]) As SumCM5, Sum([CaMass6]) As SumCM6, Sum([CaMass7]) As SumCM7, ([SumCM1] + [SumCM2] + [SumCM3] + [SumCM4] + [SumCM5] + [SumCM6] + [SumCM7]) As CaTotal
      FROM TableName;

      Originally posted by scapistr00
      Access landed on my desk late last week at work, and I was told to try and make it work for us. We currently use Excel to store our data, which is a bit cumbersome. But it does allow us to make simple calculations in the data base. I was wondering how to pull values from fields so that some calculations may be made with the data and sent to another field.

      I'm attempting to sum 7 fields (CaMass1, CaMass2...) and have them sumed to CaTotal.

      Any help would be nice. Thanks

      Comment

      Working...