Easy subform links just missing something need help

supa_sumo

Registered User.
Local time
Yesterday, 23:56
Joined
Jul 1, 2004
Messages
48
Ok ive got one subform displaying details on bikes and i have 3 other subforms displaying well information on the bikes.Repairs,Hires,Other info(All calculated fields The BreakevenPrice when the bike is sold etc)these forms are identicle but ive just added frmBreakevenPrice Subform I cannot enter [frmSubBikes].Form![BikeID] as the link master field dunno if just having BikeID in the affects it. But anyway this code when it runs Me.Parent![frmBreakevenPrice].Requery
It sais Microsoft access cannot find the field 'frmBreakevenPrice' Refered to in your expression.

Private Sub Form_Current()

Dim strParentDocName As String

On Error Resume Next
strParentDocName = Me.Parent.Name

If Err <> 0 Then

Else
On Error GoTo Form_Current_Err
Me.Parent![frmSubHires].Requery
Me.Parent![frmSubRepairs].Requery
Me.Parent![frmBreakevenPrice].Requery
End If

Form_Current_Exit:
Exit Sub

Form_Current_Err:
MsgBox Err.Description
Resume Form_Current_Exit

End Sub

All three subforms are identical as far as i can tell and the name of the subform is deffinatly frmBreakevenPrice.
What have i missed
 
Forms are displayed on other forms by means of a SubFormControl. This SubFormControl has a name of its own that does *not* have to be the same as the SubForm. You are really using the SubFormControl name in your reference. I would reference the subform for requery with:
Me.Parent!SubFormControlName.Form.Requery
 
I didnt notice that must have forgoten to type it in, you were right :)
 

Users who are viewing this thread

Back
Top Bottom