Question : Data Source and Populate Field

I am having a brain laps.

I am using this formula in the Data Source

=IIf(IsNull([cboDeliveryDate]),"",DLookUp("PriceExpDate","MaintDelSched","DeliveryDate = #" & [cboDeliveryDate] & "#"))

on the Other Tab the name is "PriceExpDate"

How do I get the answer of the formula to populate the field in the database "PriceExpDate"

Any help would greatly be appreciated.

Answer : Data Source and Populate Field

If you want to store the result of calculation in a database field, you set the controlsource of the textbox to the field and you have to put the value in using vba code.

In the Form_Beforeupdate event procedure you need to do..

me.priceexpdate =IIf(IsNull([cboDeliveryDate]),"",DLookUp("PriceExpDate","MaintDelSched","DeliveryDate = #" & [cboDeliveryDate] & "#"))
Random Solutions  
 
programming4us programming4us