473,326 Members | 2,076 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,326 software developers and data experts.

Trying To Reference SubForm: "2467 Object closed or does not exist"?

I've got a parent form and three subforms.

Two of them work A-OK.

For the third one, in the Immediate window:
-----------------------------------------
?Me.subDeal.Name
subDeal

?Me.subDeal.SourceObject
frmDeal_Deal

?Me.subDeal.RecordSource
2467 - Object closed or does not exist
-----------------------------------------

So it seems like it sort of exists, but doesn't exist.... depending on what
props I try to get to.

Tried SaveAsText and then LoadFromText, but nothing changed.

I recall similar situations years ago and hazily recall that in one of them it
was something to with not having any records behind the subform... but I've got
a dummy table there... (I think.... because I can't check it in Immediate or
in code).

Anybody been here?
--
PeteCresswell
Jul 14 '06 #1
5 4692
Per (PeteCresswell):
>So it seems like it sort of exists, but doesn't exist.... depending on what
props I try to get to.
Oh yeah... and all 3 subforms are in separate tabs on a Tab control... and
there's also a Tree control on the form.
--
PeteCresswell
Jul 15 '06 #2
On Fri, 14 Jul 2006 20:03:24 -0400, "(PeteCresswell)" <x@y.Invalidwrote:
>I've got a parent form and three subforms.

Two of them work A-OK.

For the third one, in the Immediate window:
-----------------------------------------
?Me.subDeal.Name
subDeal

?Me.subDeal.SourceObject
frmDeal_Deal

?Me.subDeal.RecordSource
2467 - Object closed or does not exist
-----------------------------------------
?Me.subDeal.Form.Recordsource

Recordsource is a property of the form contained in the subform control, not of
the subform control itself.

Me.subDeal.Name and Me.subDeal.SourceObject work because they are referring to
properties of the subform control itself.
>
So it seems like it sort of exists, but doesn't exist.... depending on what
props I try to get to.

Tried SaveAsText and then LoadFromText, but nothing changed.

I recall similar situations years ago and hazily recall that in one of them it
was something to with not having any records behind the subform... but I've got
a dummy table there... (I think.... because I can't check it in Immediate or
in code).

Anybody been here?
Wayne Gillespie
Gosford NSW Australia
Jul 15 '06 #3
Per Wayne Gillespie:
>?Me.subDeal.Form.Recordsource

Recordsource is a property of the form contained in the subform control, not of
the subform control itself.
I mis-typed in the post.

Here's a Copy/Paste from the actual VBA:
---------------------------------------------
9020 With Me
9021 .subDeal.Form.RecordSource = ""
9022 .subMetrics.Form.RecordSource = ""
9023 .subPaymentHistory.Form.RecordSource = ""
9024 .subPriceHistory.Form.RecordSource = ""
9025 .subTranche.Form.RecordSource = ""
9029 End With

9030 WorkTable_Create "ttblDealCache_Deal", "zmtblDealCache_Deal"
9031 WorkTable_Create "ttblDealCache_MetricHistory",
"zmtblDealCache_MetricHistory"
9032 WorkTable_Create "ttblDealCache_PaymentHistory",
"zmtblDealCache_PaymentHistory"
9033 WorkTable_Create "ttblDealCache_PriceHistory",
"zmtblDealCache_PriceHistory"
9034 WorkTable_Create "ttblDealCache_Tranche", "zmtblDealCache_Tranche"
9039 WorkTable_Create "ttblDealCache_TrancheFund", "zmtblDealCache_TrancheFund"

9040 With Me
9041 .subDeal.Form.RecordSource = "ttblDealCache_Deal"
9042 .subMetrics.Form.RecordSource = "qryDeal_MetricHistory"
9043 .subPaymentHistory.Form.RecordSource = "qryDeal_PaymentHistory"
9044 .subPriceHistory.Form.RecordSource = "qryDeal_PriceHistory"
9045 .subTranche.Form.RecordSource = "qryDeal_Tranche"
9049 End With
---------------------------------------------

To me, the puzzler is why .subDeal fails and the other four work.

I *know* I've been here before but cannot remember what the cause was.
--
PeteCresswell
Jul 15 '06 #4
On Sat, 15 Jul 2006 12:33:25 -0400, "(PeteCresswell)" <x@y.Invalidwrote:
>Per Wayne Gillespie:
>>?Me.subDeal.Form.Recordsource

Recordsource is a property of the form contained in the subform control, not of
the subform control itself.

I mis-typed in the post.

Here's a Copy/Paste from the actual VBA:
---------------------------------------------
9020 With Me
9021 .subDeal.Form.RecordSource = ""
9022 .subMetrics.Form.RecordSource = ""
9023 .subPaymentHistory.Form.RecordSource = ""
9024 .subPriceHistory.Form.RecordSource = ""
9025 .subTranche.Form.RecordSource = ""
9029 End With

9030 WorkTable_Create "ttblDealCache_Deal", "zmtblDealCache_Deal"
9031 WorkTable_Create "ttblDealCache_MetricHistory",
"zmtblDealCache_MetricHistory"
9032 WorkTable_Create "ttblDealCache_PaymentHistory",
"zmtblDealCache_PaymentHistory"
9033 WorkTable_Create "ttblDealCache_PriceHistory",
"zmtblDealCache_PriceHistory"
9034 WorkTable_Create "ttblDealCache_Tranche", "zmtblDealCache_Tranche"
9039 WorkTable_Create "ttblDealCache_TrancheFund", "zmtblDealCache_TrancheFund"

9040 With Me
9041 .subDeal.Form.RecordSource = "ttblDealCache_Deal"
9042 .subMetrics.Form.RecordSource = "qryDeal_MetricHistory"
9043 .subPaymentHistory.Form.RecordSource = "qryDeal_PaymentHistory"
9044 .subPriceHistory.Form.RecordSource = "qryDeal_PriceHistory"
9045 .subTranche.Form.RecordSource = "qryDeal_Tranche"
9049 End With
---------------------------------------------

To me, the puzzler is why .subDeal fails and the other four work.

I *know* I've been here before but cannot remember what the cause was.
Have you tried making the recordsource of .subDeal a query instead of the table?
I have no idea why this would make a difference, but it is the only difference I
can see between the 5 calls.
Wayne Gillespie
Gosford NSW Australia
Jul 15 '06 #5
Per Wayne Gillespie:
>
Have you tried making the recordsource of .subDeal a query instead of the table?
I have no idea why this would make a difference, but it is the only difference I
can see between the 5 calls.
I resisted the temptation for awhile - but now that you've said it too, gave it
a try. No-go.

What I did do, however, was completely rebuild the form from scratch and guess
what?.... All problems magically went away.

I copied the VBA code from the old form to the new form, didn't rebuild the
subforms, but did create all objects in the new form from scratch.

Now that I've done it, I'm positive that I went through this at least once -
maybe twice - some years ago. Same scenario: parent form with a TreeView
control and several subforms... goofy stuff with semi-existing Form objects on
the subs... and a couple of other things. I even found some notes in an old app
about the TreeView acting strange if the form it resided on didn't have a
..RecordSet....

For now, I'll put my money on MS's TreeView control (MSComctlLib.TreeCtrl.2). It
definitely acts goofey at times in other ways... and I suspect it's a little
shaky.
--
PeteCresswell
Jul 15 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Pablo J Royo | last post by:
Hello: i have a function that reads a file as an argument and returns a reference to an object that contains some information obtained from the file: FData &ReadFile(string FilePath); But ,...
2
by: brazilnut52 | last post by:
I am going to outline the steps I go through to produce the problem. Hopefully this will help you understand the problem better I have created a simple COM DLL in .NET by using the COM class...
7
by: Bennett Haselton | last post by:
Is there any way to find a string representing an object's class, which will work in Internet Explorer 6? "typeof" doesn't work -- it returns "object" for all objects: x =...
0
by: Dirk Försterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). ...
2
by: Rajat Tandon | last post by:
Hi, I have a grid which is continuously updating by the data from a external event. When I close the form on which the grid is placed, then it gives the error message ... "Can not access a...
5
by: Frederick Gotham | last post by:
If we have a simple class such as follows: #include <string> struct MyStruct { std::string member; MyStruct(unsigned const i) {
10
by: desperateloser | last post by:
1st - This is likely pathetically simple and not at all what this site is for, being mostly a snafu using regular Acess stuff and not at all coding or scripting. Please be merciful - I'm really very...
3
by: =?Utf-8?B?QmFkaXM=?= | last post by:
I'm doing a server side automation(I know it's bad but..) and its working fine locally and when accessing it from a remote machine using web browser is was giving me this error"Retrieving the COM...
6
by: weston | last post by:
In Access 2000 I have a form with a tab control with 3 tabs. I have a button that is supposed to check if each question on the form has been completed. The code that is under this button is below. It...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.