Connecting Tech Pros Worldwide Help | Site Map

trouble refering to one subform from another

rhc
Guest
 
Posts: n/a
#1: Sep 4 '06
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

pietlinden@hotmail.com
Guest
 
Posts: n/a
#2: Sep 4 '06

re: trouble refering to one subform from another


one of these two should do it...
http://www.mvps.org/access/forms/frm0025.htm
http://www.mvps.org/access/forms/frm0031.htm

David W. Fenton
Guest
 
Posts: n/a
#3: Sep 5 '06

re: trouble refering to one subform from another


"rhc" <rhcclark@yahoo.comwrote in
news:1157403313.472710.122960@74g2000cwt.googlegro ups.com:
Quote:
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/
rhc
Guest
 
Posts: n/a
#4: Sep 5 '06

re: trouble refering to one subform from another


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:
Quote:
"rhc" <rhcclark@yahoo.comwrote in
news:1157403313.472710.122960@74g2000cwt.googlegro ups.com:
>
Quote:
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/
David W. Fenton
Guest
 
Posts: n/a
#5: Sep 5 '06

re: trouble refering to one subform from another


"rhc" <rhcclark@yahoo.comwrote in
news:1157466433.051939.144690@d34g2000cwd.googlegr oups.com:
Quote:
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/
Closed Thread