By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 1,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

trouble refering to one subform from another

P: n/a
rhc
access 2000

I have a tab control with 2 pages and one subform on each.

On parent form P from the form_current() event of subform A I cant seem
to refer to subform B.

msgbox forms![P].form.name

works

msgbox forms![P]![b].form.name

does not.

A and B are the names of the subform controls and the forms themselves.

thanks in advance for any help.

Bob

Sep 4 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"rhc" <rh******@yahoo.comwrote in
news:11**********************@74g2000cwt.googlegro ups.com:
access 2000

I have a tab control with 2 pages and one subform on each.

On parent form P from the form_current() event of subform A I cant
seem to refer to subform B.

msgbox forms![P].form.name

works

msgbox forms![P]![b].form.name

does not.

A and B are the names of the subform controls and the forms
themselves.

thanks in advance for any help.

Bob
From:

Forms!P!A.Form

you ought to be able to refer to

Forms!P!B.Form

As:

Me.Parent!B.Form

And vice versa.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Sep 5 '06 #3

P: n/a
rhc
David thanks for the help. What im really trying to do is reference
subform B's recordsetclone using Set rst =
Me.Parent![b].recordsetclone. And that doesnt work. Neither does
Forms![P]![b].recordsetclone. The error msg I get is:

Object doesnt support this property or method.

I have tried every variation i can think of

David W. Fenton wrote:
"rhc" <rh******@yahoo.comwrote in
news:11**********************@74g2000cwt.googlegro ups.com:
access 2000

I have a tab control with 2 pages and one subform on each.

On parent form P from the form_current() event of subform A I cant
seem to refer to subform B.

msgbox forms![P].form.name

works

msgbox forms![P]![b].form.name

does not.

A and B are the names of the subform controls and the forms
themselves.

thanks in advance for any help.

Bob

From:

Forms!P!A.Form

you ought to be able to refer to

Forms!P!B.Form

As:

Me.Parent!B.Form

And vice versa.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Sep 5 '06 #4

P: n/a
"rhc" <rh******@yahoo.comwrote in
news:11**********************@d34g2000cwd.googlegr oups.com:
David thanks for the help. What im really trying to do is
reference subform B's recordsetclone using Set rst =
Me.Parent![b].recordsetclone. And that doesnt work. Neither
does Forms![P]![b].recordsetclone. The error msg I get is:

Object doesnt support this property or method.

I have tried every variation i can think of
I never set recordset variables for that. I'd only use a WITH block.

The reason what you're trying doesn't work is because you aren't
using the form, the but subform control. What you want is:

With Me.Parent!B.Form.RecordsetClone
...
End With

The should do it.

(I don't know why you keep using the brackets, unless the actual
name of your form has spaces or strange characters in it; if it
does, I'd suggest you stop using spaces and strange characters in
your names for Access objects as it necessitates the use of the
brackets, which can lead to problems in some cases)

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Sep 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.