Form Design

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

Guest

I would like to design a form where I would merge together the contents of
three (already filled) fields together (i.e. auto number & two separate text
fields). The results of this merger would be placed into text field both on
the form and the table in access. I have been able to do this using a query,
but do not know how to place query into field in table or form.

What would be the best way to accomplish this task?

Would I write VBA code on an event ?

Could I get an example of this code?

Thank you …..
 
JB,

The short answer is "don't do it"--calculated "fields" are just that. It is
faster, and more importantly, more reliable to calculate the value on-the-fly
than attempting to save it to a table field. If the data of any of the
fields involved in the calculation changes outside the context of your form
where VBA code is saving the calculation to a field, your calculation will be
wrong.

Base your form on a query that includes the calculated field, or set an
unbound textbox' ControlSource equal to the calculated expression:

=YourAutoNumber & YourFirstTextField & YourSecondTextField

Sprinks
 
Thank you ....
--
JLB


Sprinks said:
JB,

The short answer is "don't do it"--calculated "fields" are just that. It is
faster, and more importantly, more reliable to calculate the value on-the-fly
than attempting to save it to a table field. If the data of any of the
fields involved in the calculation changes outside the context of your form
where VBA code is saving the calculation to a field, your calculation will be
wrong.

Base your form on a query that includes the calculated field, or set an
unbound textbox' ControlSource equal to the calculated expression:

=YourAutoNumber & YourFirstTextField & YourSecondTextField

Sprinks
 
Back
Top