Second Post: Refferencing Nested SubForms

  • Thread starter Thread starter Kahuna
  • Start date Start date
K

Kahuna

Hi Folks - really struggling to workout how to reference my MainForm from a
Nested Subform. Here's my structure:

MainForm
TabPanel1

(Reason for this structure is because of the need for nested TabPanels)

I need SubForm2 Master/Child references to reference the MainForm
RecordSource.

Currently, by simply linking SubForm2!fc_id to MainForm!fc_id I get the 1st
record from the MainForm recordsource regardless where the cursor is in that
recordsource.

I have tried using a reference to the [MainForm]![fc_id] as the parent and
similar for the SubForm2 but they error when not finding the object!

Any suggestions on how to reference these would be welcomed.

Cheers
 
hi,
Hi Folks - really struggling to workout how to reference my MainForm from a
Nested Subform. Here's my structure:
Have you considered using Me.Parent? E.g.

MsgBox Me.Parent.Parent.Parent.Form.Name

But keep in mind that you must check Parent with

If Not ...Parent Is Nothing Then
'parent
Else
'no parent
End If


mfG
--> stefan <--
 
Stefan Hoffmann said:
hi,

Have you considered using Me.Parent? E.g.

MsgBox Me.Parent.Parent.Parent.Form.Name

But keep in mind that you must check Parent with

If Not ...Parent Is Nothing Then
'parent
Else
'no parent
End If


mfG
--> stefan <--

Obviously being a bit dumb today Stefan - but cant quite see how I could use
that in the Master / Child link?

Any hints on how to apply that structure to my set-up?
 
hi,
Obviously being a bit dumb today Stefan - but cant quite see how I could use
that in the Master / Child link?
I didn't read that.Just modify your record source of the first subform,
add the main form recordsource as a full join. Then you simple set the
master-child relation ship with these fields.


mfG
--> stefan <--
 
Stefan Hoffmann said:
I didn't read that.Just modify your record source of the first subform,
add the main form recordsource as a full join. Then you simple set the
master-child relation ship with these fields.
The RecordSource of the SubForm1 is a join between MainForm Recordsource and
the SubForm2 table so that would achieve what you have suggested Stefan -
but that does'nt work - as noted earlier. This still liknks me to the 1st
record in the MainForm recsrc?

Any further suggestions?
 
Back
Top