New macro doesn't update existing records

C

CW

On one of my forms I have a combo where various types of product can be
selected.
I have two controls where the appropriate costs and charges are shown.
These are populated by means of a macro that looks into the table and pulls
out the relevant values, according to the selected product.

I have now added a further value to the table, and a new control for it to
be displayed, and have added a further SetValue line to the macro to populate
this new field/control.

It all works fine when a new record is added, or if the selected product is
changed. However, on all the existing records the new control has not been
populated. I have tried Refresh but no good.

How can I get the macro to run in full including its new third element and
update all the existing records?

Many thanks
CW
 
S

Steve Schapel

CW,

You didn't mention what event is used to run the macro, so it is hard to
give a specific response.

However, it would seem that in the table that your form is based on, you are
storing values that have been looked up, or derived, or calculated, from
values already stored in other tables. As a database design principle, this
is generally regarded as an incorrect idea. These values should generally
be retrieved "on the fly", via expressions in the control source of unbound
controls on your forms or reports, or via queries.

Please see if there is anything in this article that will help:
http://accesstips.datamanagementsolutions.biz/lookup.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top