I have a form with a subform, the private sub below gets the
banner code from the main form. Now i want the percentage field to get its value from the id field , which should lookup the product table, percentage field. works fine for the first record in the subform
when it gets to the second line on the subform it gives the same value for each subsequent line.
How can i go through line of the subform
ie:
subform has
id, descript, quantity, price, percentage, total as fields.
1...book1.....5.........$3.00..10..........$13.50 (line 1)
Now all the subsequent line ...10 give the same percentage
value regardless if the ID field changes, so how do i get
the proper value from the table in line 2 etc.
Private Sub Remise___LostFocus()
Dim intSearch As Integer
Dim value As Variant
intSearch = Me![product]
If Forms!Orders.[Banner Code] = 55 Then
value = DLookup("[Price1]", "Produits", intSearch)
Me![Percentage]= value
End If
End Sub
Hope this is not to poorly explained...
Any help would be appreciated.
TIA
André
banner code from the main form. Now i want the percentage field to get its value from the id field , which should lookup the product table, percentage field. works fine for the first record in the subform
when it gets to the second line on the subform it gives the same value for each subsequent line.
How can i go through line of the subform
ie:
subform has
id, descript, quantity, price, percentage, total as fields.
1...book1.....5.........$3.00..10..........$13.50 (line 1)
Now all the subsequent line ...10 give the same percentage
value regardless if the ID field changes, so how do i get
the proper value from the table in line 2 etc.
Private Sub Remise___LostFocus()
Dim intSearch As Integer
Dim value As Variant
intSearch = Me![product]
If Forms!Orders.[Banner Code] = 55 Then
value = DLookup("[Price1]", "Produits", intSearch)
Me![Percentage]= value
End If
End Sub
Hope this is not to poorly explained...
Any help would be appreciated.
TIA
André