How do i get a field to use a previous fields value.

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

Guest

I have a form called F_CEC%, this has a record source of T_CEC%. There are
five columns in the form 1= Charges to, 2= 2004-05%, 3= 2005-06%, 4=2006-07%
& 5=2007-08%. These get filled in on the form. But what I want to do is have
2004-08% use and store the 2006-07% by default or untill it is overtyped in
the form.

Is there anyway of doing this??
 
On Tue, 19 Oct 2004 03:19:02 -0700, Antony Elson <Antony
But what I want to do is have
2004-08% use and store the 2006-07% by default or untill it is overtyped in
the form.

Is there anyway of doing this??

Yes - you can set the DefaultValue property of a textbox in that
textbox's AfterUpdate event.

But I'm confused about your form and table structure! Do you have
*table fields* named 2004 and 2005, with values 6% and so on? What
will you do next year - change all your fieldnames, and all your
control names? I fear you're really on the wrong track, or that I'm
completely misunderstanding your form structure! Care to explicate?

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
John,

Thanks for your reply.

As to the names of the fields used, we do need to use these names as the
information is used elsewhere,

To simplify my request. "Sorry if I waffled on"

I have a table with 5 columns

And a form linked to this table with the same 5 fields in it, these can be
directly typed into via the form.

What I want to happen in the form is in the form, when I type a value into
field 4 field 5 uses this vale and adds it to the table as if I had typed it
in.
 
John,

Thanks for your reply.

As to the names of the fields used, we do need to use these names as the
information is used elsewhere,

Then you will have to redesign your database in a bit under three
months. If that's ok with you I won't argue, but it seems like a
strange way to run your business!
To simplify my request. "Sorry if I waffled on"

I have a table with 5 columns

And a form linked to this table with the same 5 fields in it, these can be
directly typed into via the form.

What I want to happen in the form is in the form, when I type a value into
field 4 field 5 uses this vale and adds it to the table as if I had typed it
in.

Again - I DON'T know the names of your form controls (which are not
necessarily the same as the names of the table fields to which they
are bound). Assuming that you have two textboxes named Field4 and
Field5, you could use the following code in the AfterUpdate event of
Field4:

Private Sub Field4_AfterUpdate()
If Me![Field5] & "" = "" Then 'don't overwrite existing data
Me!Field5 = Me!Field4
End If
End Sub

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top