Calculations between 2 subforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Not quite sure how to handle this problem, hopefully someone can help :-

I've two subforms; the first subform has line items with charges. Each line item is numbered. One the second subform I want to be able to enter the a line number from the first subform, enter an amount and then calculate the difference between the first subform and the second subforms amt. There can be multiple line numbers to choose from therefore, I need to be able to pull the charged amount from the first subform where the "line number" is equal to the "line number" entered on the second subform

Any help at this point is greatly appreciated.

Cath
 
Cathi said:
Not quite sure how to handle this problem, hopefully someone can help :-)

I've two subforms; the first subform has line items with charges. Each line item is numbered. One the second subform I want to be able to enter the a line number from the first subform, enter an amount and then calculate the difference between the first subform and the second subforms amt. There can be multiple line numbers to choose from therefore, I need to be able to pull the charged amount from the first subform where the "line number" is equal to the "line number" entered on the second subform.


You can search the first subform's RecordsetClone to find
the record with the same item number and then retrieve
whatever field's value you want:

With Me.Parent.firstsubform.Form.RecordsetClone
.FindFirst "[itemnumber] = " & Me.txtitemnumber
If .NoMatch Then
MsgBox "No such item number"
Exit sub
Else
difference = Me.txtamount - !itemcharge
End If
End With
 
Back
Top