My main form is called Form1, and my subform is testquery2_subform.
Whats happening is, the customers information(first name, last name, etc...), and the delivery/pickup dates, is on my main form. And my subform has the items that make up the order, tents, tables, chairs, etc...
For example if a customer orderd 5 tables and 30 chairs, there would be 2 rows in the subform.
I have gotten to the point where I put an onUpdate event on the subform where if I update a record it will mulitply the number or chairs or whatever by 2 and put that value into my main form. The problem is this only works for 1 row, I can't get it to update from all the records in the subform (that match the specific order number)
This is what I have now...
Expand|Select|Wrap|Line Numbers
- Private Sub Form_AfterUpdate()
- Dim sendval As String
- Dim val1 As String
- Dim val2 As String
- Dim val3 As String
- Dim val4 As String
- Dim val5 As String
- Dim val6 As String
- If Not IsNull(txtNumTables) Then
- val1 = txtNumTables
- End If
- If Not IsNull(txtnumChairs) Then
- val2 = txtnumChairs
- End If
- If Not IsNull(txtnumT_Cloths) Then
- val3 = txtnumT_Cloths
- End If
- val4 = "2"
- val5 = "4"
- val6 = "1"
- sendval = 0
- sendval = sendval + (Val(val1) * Val(val4))
- sendval = sendval + (Val(val2) * Val(val5))
- sendval = sendval + (Val(val3) * Val(val6))
- Forms![Form1]![txtTotal] = sendval
- End Sub
Scotter