0

I have a basic Table called ReceiveReport which contains the fallowing fields ID, Units, GrossWt, NetWt, TareWt. I allow the user to select his units (lbs, kgs) afterwards he has to enter gross/net/tare weight into the fields. I want the fields to update them self depending on the unit field. I tried using the After Insert Macro, but I couldn't use SetField which made me confused about how to update the field.

I want to do something fairly basic.

iff([units] = "lbs", [field]*2.2046, Do Nothing )

am I going at this the wrong way?

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
Joshua Dalley
  • 339
  • 3
  • 6
  • 23

1 Answers1

2

You could update the value in a Before Change macro like the following. The approach I chose leaves the [units] and [weight_entered] values intact and updates a separate field named [weight_kg], but you could also overwrite the values that were originally entered if that was your preference.

BeforeChange.png

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
  • @GoldThompson Would I just append another If statement after the first one, since I already got a before change macro. [http://stackoverflow.com/questions/24312900/automatically-generate-date-4-digit-sequence-number-for-id-in-access-2010](http://stackoverflow.com/questions/24312900/automatically-generate-date-4-digit-sequence-number-for-id-in-access-2010) – Joshua Dalley Aug 25 '14 at 16:51
  • 1
    @JoshuaDalley That should be fine. A given table can have only one Before Change macro and that macro can perform several tasks if necessary. – Gord Thompson Aug 25 '14 at 16:53