Hi all,
I have a very simple database which I have attached. I've created a form based on one table. I want one of the fields to automatically look up the value from the other table and update the original table with an AfterUpdate event.
This is the code:
Option Compare Database
Option Explicit
Public Sub Shipment_Terms_AfterUpdate()
Me.Shipment_Rate = DLookup("CM3_Net", "Freight", "Shipment_Terms=" & "Company")
End Sub
I know I'm probably doing something very basic wrong but I can't work out what it is!
I want the "Shipment Rate" field to be the one updated with the relevant "CM3 Net" from the "Freight" table.
Can anyone help?
Thanks,
Nick
I have a very simple database which I have attached. I've created a form based on one table. I want one of the fields to automatically look up the value from the other table and update the original table with an AfterUpdate event.
This is the code:
Code:
Option Explicit
Public Sub Shipment_Terms_AfterUpdate()
Me.Shipment_Rate = DLookup("CM3_Net", "Freight", "Shipment_Terms=" & "Company")
End Sub
Code:
I know I'm probably doing something very basic wrong but I can't work out what it is!
I want the "Shipment Rate" field to be the one updated with the relevant "CM3 Net" from the "Freight" table.
Can anyone help?
Thanks,
Nick