Cloning the RecordSet of a Grandchild form

D

dch3

I need to clone the recordSet of a grandchild form, but the following statement

set rsClone =
[Forms]![frmTrailerActivity]![subfrmTrailerActivity].Form![subfrmTrailerUsageComments].Form.RecordsetClone

returns an error message - 'Invalid reference to the Form/Report'. When I
take out the second .Form. the error message is returned is (something to the
effect of) 'Object doesnot that support that property/method'

Ideas?
 
K

Klatuu

You may have this correct, but just to double check,
[subfrmTrailerActivity] should be the name of the subform control on
[frmTrailerActivity], not the name of the form being used as a subform.
And
[subfrmTrailerUsageComments] should be the subform control name on the form
that is being used as the subform in [frmTrailerActivity] subform control.
 
D

dch3

Here's the results of snooping around in the immediate window...
(The double lines represent individual lines that couldn't be displayed on a
single line on this forum)

....any ideas, I'm stumpified... (May I should get Chuck Norris to roundhouse
kick Access)

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].name

subfrmTrailerActivity

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].controls.count

25

?[forms]![frmTrailerActivity]![subfrmTrailerActivity].controls(24).name

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]!
[subfrmTrailerUsageComments].properties(2).name

ControlType

?acsubform

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties(2).value

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties("SourceObject")

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.controls.count

'You Entered an Expression that has an invalid reference to property
form/report.

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.name

'You Entered an Expression that has an invalid reference to property
form/report.

Klatuu said:
You may have this correct, but just to double check,
[subfrmTrailerActivity] should be the name of the subform control on
[frmTrailerActivity], not the name of the form being used as a subform.
And
[subfrmTrailerUsageComments] should be the subform control name on the form
that is being used as the subform in [frmTrailerActivity] subform control.
--
Dave Hargis, Microsoft Access MVP


dch3 said:
I need to clone the recordSet of a grandchild form, but the following statement

set rsClone =
[Forms]![frmTrailerActivity]![subfrmTrailerActivity].Form![subfrmTrailerUsageComments].Form.RecordsetClone

returns an error message - 'Invalid reference to the Form/Report'. When I
take out the second .Form. the error message is returned is (something to the
effect of) 'Object doesnot that support that property/method'

Ideas?
 
D

dch3

(I did also try [Me!Subform1.Form!Subform2.Form.RecordSource] to no avail)

dch3 said:
Here's the results of snooping around in the immediate window...
(The double lines represent individual lines that couldn't be displayed on a
single line on this forum)

...any ideas, I'm stumpified... (May I should get Chuck Norris to roundhouse
kick Access)

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].name

subfrmTrailerActivity

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].controls.count

25

?[forms]![frmTrailerActivity]![subfrmTrailerActivity].controls(24).name

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]!
[subfrmTrailerUsageComments].properties(2).name

ControlType

?acsubform

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties(2).value

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties("SourceObject")

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.controls.count

'You Entered an Expression that has an invalid reference to property
form/report.

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.name

'You Entered an Expression that has an invalid reference to property
form/report.

Klatuu said:
You may have this correct, but just to double check,
[subfrmTrailerActivity] should be the name of the subform control on
[frmTrailerActivity], not the name of the form being used as a subform.
And
[subfrmTrailerUsageComments] should be the subform control name on the form
that is being used as the subform in [frmTrailerActivity] subform control.
--
Dave Hargis, Microsoft Access MVP


dch3 said:
I need to clone the recordSet of a grandchild form, but the following statement

set rsClone =
[Forms]![frmTrailerActivity]![subfrmTrailerActivity].Form![subfrmTrailerUsageComments].Form.RecordsetClone

returns an error message - 'Invalid reference to the Form/Report'. When I
take out the second .Form. the error message is returned is (something to the
effect of) 'Object doesnot that support that property/method'

Ideas?
 
K

Klatuu

Me! will not work in the immediate window unless you have code running in the
current form and have stopped it in debug mode.

I don't have anything that goes 3 levels down, but I did some syntax
checking in the immediate window like this

set frm = forms!frmdashboard!subinitiative

?frm.sourceobject
subfStartInit

?frm.controls(0).name
txtStatus

?frm.controls(0)
WIP

?frm.form.controls(0)
WIP

?frm.recordset.recordcount
<Error 438>

?frm.form.recordset.recordcount
34

Note that addressing control value without Form works in this context (but I
do included for self documenting purposes), but addressing the recordset
requires the form reference.
--
Dave Hargis, Microsoft Access MVP


dch3 said:
(I did also try [Me!Subform1.Form!Subform2.Form.RecordSource] to no avail)

dch3 said:
Here's the results of snooping around in the immediate window...
(The double lines represent individual lines that couldn't be displayed on a
single line on this forum)

...any ideas, I'm stumpified... (May I should get Chuck Norris to roundhouse
kick Access)

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].name

subfrmTrailerActivity

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].controls.count

25

?[forms]![frmTrailerActivity]![subfrmTrailerActivity].controls(24).name

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]!
[subfrmTrailerUsageComments].properties(2).name

ControlType

?acsubform

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties(2).value

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties("SourceObject")

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.controls.count

'You Entered an Expression that has an invalid reference to property
form/report.

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.name

'You Entered an Expression that has an invalid reference to property
form/report.

Klatuu said:
You may have this correct, but just to double check,
[subfrmTrailerActivity] should be the name of the subform control on
[frmTrailerActivity], not the name of the form being used as a subform.
And
[subfrmTrailerUsageComments] should be the subform control name on the form
that is being used as the subform in [frmTrailerActivity] subform control.
--
Dave Hargis, Microsoft Access MVP


:

I need to clone the recordSet of a grandchild form, but the following statement

set rsClone =
[Forms]![frmTrailerActivity]![subfrmTrailerActivity].Form![subfrmTrailerUsageComments].Form.RecordsetClone

returns an error message - 'Invalid reference to the Form/Report'. When I
take out the second .Form. the error message is returned is (something to the
effect of) 'Object doesnot that support that property/method'

Ideas?
 
D

dch3

Let me snoop around a bit more, but I think I'm going to give up since I have
bigger fish to fry - like developing cold fusion, finding an low-cost and
environmentally friendly all-purpose, alternative fuel source, solving world
hunger and find a wife all before dinner tonight.

Klatuu said:
Me! will not work in the immediate window unless you have code running in the
current form and have stopped it in debug mode.

I don't have anything that goes 3 levels down, but I did some syntax
checking in the immediate window like this

set frm = forms!frmdashboard!subinitiative

?frm.sourceobject
subfStartInit

?frm.controls(0).name
txtStatus

?frm.controls(0)
WIP

?frm.form.controls(0)
WIP

?frm.recordset.recordcount
<Error 438>

?frm.form.recordset.recordcount
34

Note that addressing control value without Form works in this context (but I
do included for self documenting purposes), but addressing the recordset
requires the form reference.
--
Dave Hargis, Microsoft Access MVP


dch3 said:
(I did also try [Me!Subform1.Form!Subform2.Form.RecordSource] to no avail)

dch3 said:
Here's the results of snooping around in the immediate window...
(The double lines represent individual lines that couldn't be displayed on a
single line on this forum)

...any ideas, I'm stumpified... (May I should get Chuck Norris to roundhouse
kick Access)

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].name

subfrmTrailerActivity

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].controls.count

25

?[forms]![frmTrailerActivity]![subfrmTrailerActivity].controls(24).name

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]!
[subfrmTrailerUsageComments].properties(2).name

ControlType

?acsubform

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties(2).value

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties("SourceObject")

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.controls.count

'You Entered an Expression that has an invalid reference to property
form/report.

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.name

'You Entered an Expression that has an invalid reference to property
form/report.

:

You may have this correct, but just to double check,
[subfrmTrailerActivity] should be the name of the subform control on
[frmTrailerActivity], not the name of the form being used as a subform.
And
[subfrmTrailerUsageComments] should be the subform control name on the form
that is being used as the subform in [frmTrailerActivity] subform control.
--
Dave Hargis, Microsoft Access MVP


:

I need to clone the recordSet of a grandchild form, but the following statement

set rsClone =
[Forms]![frmTrailerActivity]![subfrmTrailerActivity].Form![subfrmTrailerUsageComments].Form.RecordsetClone

returns an error message - 'Invalid reference to the Form/Report'. When I
take out the second .Form. the error message is returned is (something to the
effect of) 'Object doesnot that support that property/method'

Ideas?
 
D

dch3

I ended up using an object variable set to the grandchild form and then
cloned the recordset from there as in

Set frm = []
Set rsClone = frm.RecordSetClone

However, this page on mvps.org suggests that you can do that without having
to use an object variable.

http://www.mvps.org/access/forms/frm0031.htm

Look about 1/2 way down at the section on "To refer to a form property, like
RecordSource"

Klatuu said:
Me! will not work in the immediate window unless you have code running in the
current form and have stopped it in debug mode.

I don't have anything that goes 3 levels down, but I did some syntax
checking in the immediate window like this

set frm = forms!frmdashboard!subinitiative

?frm.sourceobject
subfStartInit

?frm.controls(0).name
txtStatus

?frm.controls(0)
WIP

?frm.form.controls(0)
WIP

?frm.recordset.recordcount
<Error 438>

?frm.form.recordset.recordcount
34

Note that addressing control value without Form works in this context (but I
do included for self documenting purposes), but addressing the recordset
requires the form reference.
--
Dave Hargis, Microsoft Access MVP


dch3 said:
(I did also try [Me!Subform1.Form!Subform2.Form.RecordSource] to no avail)

dch3 said:
Here's the results of snooping around in the immediate window...
(The double lines represent individual lines that couldn't be displayed on a
single line on this forum)

...any ideas, I'm stumpified... (May I should get Chuck Norris to roundhouse
kick Access)

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].name

subfrmTrailerActivity

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity].controls.count

25

?[forms]![frmTrailerActivity]![subfrmTrailerActivity].controls(24).name

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]!
[subfrmTrailerUsageComments].properties(2).name

ControlType

?acsubform

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties(2).value

112

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].properties("SourceObject")

subfrmTrailerUsageComments

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.controls.count

'You Entered an Expression that has an invalid reference to property
form/report.

?[Forms]![frmTrailerActivity]![subfrmTrailerActivity]![subfrmTrailerUsageComments].form.name

'You Entered an Expression that has an invalid reference to property
form/report.

:

You may have this correct, but just to double check,
[subfrmTrailerActivity] should be the name of the subform control on
[frmTrailerActivity], not the name of the form being used as a subform.
And
[subfrmTrailerUsageComments] should be the subform control name on the form
that is being used as the subform in [frmTrailerActivity] subform control.
--
Dave Hargis, Microsoft Access MVP


:

I need to clone the recordSet of a grandchild form, but the following statement

set rsClone =
[Forms]![frmTrailerActivity]![subfrmTrailerActivity].Form![subfrmTrailerUsageComments].Form.RecordsetClone

returns an error message - 'Invalid reference to the Form/Report'. When I
take out the second .Form. the error message is returned is (something to the
effect of) 'Object doesnot that support that property/method'

Ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top