473,382 Members | 1,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

trouble refering to one subform from another

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
4 1712
"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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David B | last post by:
I have a sub form in datasheet view on a form. I want a query to find the recordid every time a different row on the datasheet has the focus. The query is grabbing data for a combo on a second sub...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
3
by: Nicolae Fieraru | last post by:
Hi All, I have a problem and I can't figure out how to solve it. My database has three tables: tblCustomers, with CustomerId and CustomerName tblProducts, with ProductId and ProductCode...
3
by: Kranman | last post by:
Hi All, Love this site, have gotten a lot from it. This is my first time posting though, so forgive me for any errors. I have an Access 2000 db where I have a main form of Contractors and on...
4
by: Terri | last post by:
Main form-frmCheckRequest Sub form-subfrmCheckRequestPayments On my subform I have 2 fields FundCode and ClassNumber. Both are comboboxes. I'm trying to filter ClassNumber based on FundCode. ...
1
by: John Phelan-Cummings | last post by:
Form: Main Menu From the Main Menu you open up the main form, “Program_services” (unbound) which serves various purposes aside from the fact that it has a single unbound, first, subform,...
5
by: CanOfWorms | last post by:
Access 2003 (previous 2000) Windows XP Pro I am fairly new at VBA within Access, learning as I go thorugh forums and discussion groups. I generally find my answers through previous posts, but I...
4
by: bcallnan | last post by:
Hello All- I am trying to reference a subform's afterupdate event that is 3 deep and am having some trouble getting it to work. The control is a combo box and i cannot seem to trigger the...
5
by: Walter Konopacki | last post by:
Have a client form with an address sub form. I then open a jobs form and want to display the name and address on the jobs form. No problem with the name which is in the clients from which is the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.