Connecting Tech Pros Worldwide Help | Site Map

trouble refering to one subform from another

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 4th, 2006, 08:45 PM
rhc
Guest
 
Posts: n/a
Default trouble refering to one subform from another

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


  #2  
Old September 4th, 2006, 09:55 PM
pietlinden@hotmail.com
Guest
 
Posts: n/a
Default 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

  #3  
Old September 5th, 2006, 01:15 AM
David W. Fenton
Guest
 
Posts: n/a
Default 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/
  #4  
Old September 5th, 2006, 02:15 PM
rhc
Guest
 
Posts: n/a
Default 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/
  #5  
Old September 5th, 2006, 07:15 PM
David W. Fenton
Guest
 
Posts: n/a
Default 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/
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.