MS Database Access 2000

  TonyV 14:31 19 Mar 2006

I have been playing around with my copy of MS Access just to try and find out how it works. I put a Table in and then a Form trying to show the Electricity readings and hence costs! (I have a similar one in Approach which works fine!)

I have tried to get the Form to actually calculate the actual units used in a quarter by having Fields of "Present Reading" and another of "Previous Reading". The Units used then should be "Present Reading-Previous Reading". No it doesn't, it doesn't give any figures!

This is what I have in Approach, but it will do nothing in Access. Is there any way that the Form can calculate the Units figure?

I hasten to add, I am only playing with it to see if I can get it to operate as a reasonable Database, but I must admit, so far I have been singularly unsuccessful!!


  beynac 15:06 19 Mar 2006

You need to set the text boxes in the form to be "bound" to the fields in the table. You can do this by either using the Create Form wizard and selecting the fields or by setting them in the text boxes' properties (e.g. Control Source = "Present Reading"). You then create a new text box and set the Control Source property to "=[Present Reading]-[Previous Reading]"

  TonyV 15:23 19 Mar 2006

Many thanks for that. That worked and the answer was as expected in the Form! However, when I went in to the Table, there was no means of applying the same system there. Do you know if the Table can do similar calculations? Are they not cross related?

I must confess I've tried everything, even the big IDG publication Office 2000 Bible, and that gave nothing away there!


  TonyV 15:48 19 Mar 2006

The more I play with Access the more illogical it seems. Having got the first problem sorted, I am now trying to get the, say, first record Present Reading to be automatically entered in to the next record Previous Reading slot. Looking at the various means of adding something like this to the Form is a nightmare. Nothing seems to relate to what I am trying to do! Again a degree in maths seems to be the answer!


  beynac 15:49 19 Mar 2006

You cannot calculate within a table. It is just there to hold the data. You use queries to make calculations and manipulate the data. Forms and reports are used to display the results and, as in the example above, can be used for calculations on data held in tables or query results.

  beynac 15:53 19 Mar 2006

I suggest that you have a table for the readings with fields for 'Date' and 'Reading'. You can then build queries to query the table and make the calculations you refer to above. You would then be able to extract the information by any peiod (year, quarter) that you wanted.

The most important thing in building an Access database is planning the structure (tables, queries, forms etc.).

  TonyV 16:00 19 Mar 2006

Many thanks. I will do as you say. It just seems strange that the Table only has basic information, and the Form/Query can have other information that is not necessarily carried through to the Table. I will have a look at resetting the whole thing, just for the exercise to see if I can actually do it.

I'll close this one out now, and thanks!


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

HTC U12 Plus review: Hands-on

Best Android emulators for Mac

TV & Streaming : comment regarder Roland Garros ?