GailFialho
Registered User.
- Local time
- Today, 13:45
- Joined
- Nov 20, 2001
- Messages
- 34
Thanks in advance to anyone that can help.
Background: I'm working with WorkOrders (Parent form), each of which can have several invoices (1st subform), each of those can have numerous parts (2nd subform shows all of the parts for the WorkOrder). All come from 3 tables: WorkOrders ->Invoices -> Parts, all with proper one-to-many relationship.
1st subform has columns of currency data, each invoice broken into individual charges buckets.
The subform's footer has "Sums" controls for each column.
There are 2 additional controls in the footer that add different groupings of the "Sums" controls and produce different totals.
The parent form needs to have a control for each of these "Sums" controls and the 2 totals controls.
Placing "=[subFormName].[Form].[controlName]" into the parent controls works perfectly . . .until I get a WorkOrder that doesn't have any invoices yet. Then my parent controls show "Error".
So . . .
I have this code in the OnCurrent event of the parent form:
If Me.MainDataInvoiceSub.Form.RecordsetClone.RecordCount > 0 Then
Me.ToTInv = Me.MainDataInvoiceSub.Form.TotInvPrice
Me.TotalShop = Me.MainDataInvoiceSub.Form.TotInvCost
Else
Me.ToTInv = 0
Me.TotalShop = 0
End If
(I left a few of the control names off for brevity.)
OK SO FAR? HERE'S THE PROBLEM:
The form doesn't recognize the OnCurrent event unless I put in a break for the event. Then, if I walk throu the event, the totals are transfered to the parent for perfectly, regardless whether the subform has records or not. I've run it with numerous records and it works. As soon as I remove the break, it doesn't. I get $0.00
AAAHHHHHRRRRRR!!!!!! See, it's making me crazy!
Please save my sanity

Background: I'm working with WorkOrders (Parent form), each of which can have several invoices (1st subform), each of those can have numerous parts (2nd subform shows all of the parts for the WorkOrder). All come from 3 tables: WorkOrders ->Invoices -> Parts, all with proper one-to-many relationship.
1st subform has columns of currency data, each invoice broken into individual charges buckets.
The subform's footer has "Sums" controls for each column.
There are 2 additional controls in the footer that add different groupings of the "Sums" controls and produce different totals.
The parent form needs to have a control for each of these "Sums" controls and the 2 totals controls.
Placing "=[subFormName].[Form].[controlName]" into the parent controls works perfectly . . .until I get a WorkOrder that doesn't have any invoices yet. Then my parent controls show "Error".
So . . .
I have this code in the OnCurrent event of the parent form:
If Me.MainDataInvoiceSub.Form.RecordsetClone.RecordCount > 0 Then
Me.ToTInv = Me.MainDataInvoiceSub.Form.TotInvPrice
Me.TotalShop = Me.MainDataInvoiceSub.Form.TotInvCost
Else
Me.ToTInv = 0
Me.TotalShop = 0
End If
(I left a few of the control names off for brevity.)
OK SO FAR? HERE'S THE PROBLEM:
The form doesn't recognize the OnCurrent event unless I put in a break for the event. Then, if I walk throu the event, the totals are transfered to the parent for perfectly, regardless whether the subform has records or not. I've run it with numerous records and it works. As soon as I remove the break, it doesn't. I get $0.00
AAAHHHHHRRRRRR!!!!!! See, it's making me crazy!
Please save my sanity