I am trying to look up a rate which will be based on two conditions. Condition 1 is the ComponentID (in a combo box in a subform (continuous form) and Condition 2 is the RentalPriceBandID(in another combo box called "RentalPriceBandID" but this time in the Main Form.
I am trying to populate a bound text box "Rate" from the After Update event of the combo book on the subform which selects the component.
This is my code effort:
Private Sub ComponentID_AfterUpdate()
Me.Rate = DLookup("[RentalRate]", "zmtComponentRentRate", "[ComponentID]" And "[RentalPriceBandID]" = Me.ComponentID And Forms![Estimate]![RentalPriceBandID])
End Sub
Table zmtComponentRentRate has ComponentID, RentalRate and RentalPriceBandID.
Help most welcome
I am trying to populate a bound text box "Rate" from the After Update event of the combo book on the subform which selects the component.
This is my code effort:
Private Sub ComponentID_AfterUpdate()
Me.Rate = DLookup("[RentalRate]", "zmtComponentRentRate", "[ComponentID]" And "[RentalPriceBandID]" = Me.ComponentID And Forms![Estimate]![RentalPriceBandID])
End Sub
Table zmtComponentRentRate has ComponentID, RentalRate and RentalPriceBandID.
Help most welcome