Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form - Subform question ???????

Status
Not open for further replies.

andrep

Technical User
Feb 27, 2002
40
CA
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é
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top