auto fill unbound fields on a form??

  • Thread starter Thread starter steph
  • Start date Start date
S

steph

Hi,

I'm new to access, therefore this maybe dumb question (regarding access
2002):
I've got a form with an unbound field, which i want to fill dependent
on the other fields of the current record. That means, when i open the
form, this unbound field should get initially filled, and every time i
change a record, the unbound field should also change accordingly. I
have looked for an suitable event to place my functionality there, but
somehow nothing seems to work. What am i doing wrong?

thanks for any input,
stephan
 
Steph,

The event you must use is the Current event of the form, which fires as
you move from rcord to record, as well as when the form is first opened.

You will need some simple code to calculate and set the value based on
the other controls' values, probably something like:

Me.Text4 = Me.Text1 + Me.Text2 - Me.Text3

or whatever.

HTH,
Nikos
 
Hi Nikos,

Thanks for the hint, but I have still a sligt problem: when I'm doing
it this way, and I open the form in datasheet mode, my unbound field is
initially empty. Only when the field gets focus, i.e. i click on it,
the value for the field is derived. But then not only the unbound field
of the current record is set to this derived value, but the field is
set for all records.

br,
stephan
 
Sounds like you're using continuous forms, in which case you want to use
Me.Text4.DefaultValue

HTH;

Amy
 
Back
Top