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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple line of products

Status
Not open for further replies.

aliceapraham

Technical User
Apr 9, 2007
38
US
I have a form that has 4 fields Qty Product (which is a combobox) UnitPrice & Total.
the user must select couple of products that he is going to buy so I need to make couple of rows the same fields, & then sum the totals up.
How do i do that?
Like qty Product Unit Price total
10 Shoes $5.0 $50.0
5 Pants $6.0 $30.0
4 tops $2.0 $8.0

TOTAL: $88.0
I have the first row working, but whenever I'mm puting the second row, (Which has the same field names), it is ruining the unit prices. I'm guessing that i have to change the fields name or the codes in it.
PLS HELP. THank you
Alice
 
You have to explain a little more your issue.
Continuous subform ?
Which controls are bound and which have expression in their ControlSource property ?

Have a look at the Northwind sample database that is part of the ms-access install.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
OK the Qty field has:
Private Sub Qty_AfterUpdate()
Call PriceGrabber
End Sub
This is my Price grabber code:

Public Sub PriceGrabber()

If Trim(Me!Service & "") <> "" And Trim(Me!Qty & "") <> "" Then
If Me!Qty > 0 And Me!Qty < 10001 Then
Me!Price = Me!Price1
ElseIf Me!Qty > 10000 And Me!Qty < 25001 Then
Me!Price = Me!Price2
ElseIf Me!Qty > 25001 And Me!Qty < 75000 Then
Me!Price = Me!Price3
ElseIf Me!Qty > 75001 And Me!Qty < 1000000 Then
Me!Price = Me!Price4
Else
'Price setup for quantity > 25000
End If

'Me!SubTotal = Me!Qty * Me!Price
End If

End Sub

Then my combobox has this code:

Private Sub Combo18_AfterUpdate()

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[PriceID] = " & Str(Nz(Me![Combo18], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Call PriceGrabber
End Sub
then of course my TOTal has :
=[Qty]*[Price]/1000 in the Control source.
So i need to make the user have couple of lines with the same fields so that they pick for every line a product & the whole calculation does as it did in the first line.
when I'm doing that the first Unit price is changing according to the second line's product that I'm picking.
how can i make the first line doens't change when i pick another product in the second line.
Thnk u & sorry if my question is too long.
Alice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top