Second Post: Refferencing Nested SubForms

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
 
S

Stefan Hoffmann

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 <--
 
K

Kahuna

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?
 
S

Stefan Hoffmann

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 <--
 
K

Kahuna

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top