Copy previous fields contents

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that is linked to a table; this table has four fields in it:
2005-06%, 2006-07%. 2007-08% & 2008-9%. The form allows the user to input
into these fields. What I want is for 2008-09% to automatically use the data
typed into 2007-08%. Can anybody tell me how I get this to happen?
 
Antony,
First, don't use dashes or the percent sign in your table field names.
Try something like...
200506Pct
You know what that stands for... and your user doesn't even see that
name.
When you "label" your field on your form, you can use any text characters
you'd like.

Use the AfterUpdate event of 200708Pct to update the 200809Pct field.

Private Sub 200708Pct_ AfterUpdate()
200709Pct = 200708Pct
End Sub
 
Antony

Access is a relational database. What you described sounds like a
spreadsheet (the "repeating" fieldnames gave it away).

You will find it causes both you and Access a lot of extra work (and
headaches!) to try to use it (Access) as if it were a spreadsheet.

Another way to consider your data is that whatever you are putting into
those fields is also associated with two more pieces of data ... the year
(2005, 2006, 2007...) and the percentage (6%, 7%, ...).

If you add two fields to your table (year, percentage) and record each fact
with it's associated data, getting the "next year" to take the "last year"
data value is quite simple.

Consider looking into the topic of normalization before you try any more to
use this chainsaw (Access) to drive nails.
 
Many thanks for all of your help. I have now, with your hlep managed to get
my form working..
 
Back
Top