Problem with referencing subforms

  • Thread starter Thread starter Zeljko Matic
  • Start date Start date
Z

Zeljko Matic

I'm having problems wit referencing some properties of subforms (newrecord,
recordsetclone.recordcount) if subform level is greater of two. For example
Me![Mainform]![Subform].form.newrecord work, but
Me![Mainform]![Subform]![Subform2].form.newrecord don't work. Is there some
resolution.

Thanks in advance
 
Zeljko Matic said:
I'm having problems wit referencing some properties of subforms (newrecord,
recordsetclone.recordcount) if subform level is greater of two. For example
Me![Mainform]![Subform].form.newrecord work, but
Me![Mainform]![Subform]![Subform2].form.newrecord don't work. Is there some
resolution.

You have to expand on the first syntax.

Me![Mainform]![Subform].form![Subform2].form.newrecord
 
Two thoughts...

Are Subform1 and Subform2 actually the name of the subforms?
You need to reference the name of the subform 'control' that
holds the subform and not the name of the subform itself.

This may be an email typo, but I also notice that your
spelling of 'recordsourec' is repeated a couple of times. It
should be 'recordsource'.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Zeljko Matic said:
Forms![Mainform]![Subform1].Form![Subform2].Form.recordsoure
c.RecordCount
Me![Subform2].Form.recordsourec.RecordCount

In example:
I have main form Mainform, with subform Subform1 and subform of that subform
Sunform2
Mainform
Subform1
Subform2

Commands have been executing from subform Subform1.
this dont'work
Forms![Mainform]![Subform1].Form![Subform2].Form.recordsoure
c.RecordCount
Me![Subform2].Form.recordsourec.RecordCount
but
Forms![Mainform]![Subform1].Form.recordsourec.RecordCount
Me.Form.recordsourec.RecordCount works.

I have been using lot of syntax for referencing subsubform properties
newrecord or recordsource but without success. I have been using
constratction from document in attachment but without success.

Thanks in advanced!

subforms
(newrecord,
greater of two. For
example
Me![Mainform]![Subform].form.newrecord work, but
Me![Mainform]![Subform]![Subform2].form.newrecord
don't work. Is there
some
resolution.

You have to expand on the first syntax.

Me![Mainform]![Subform].form![Subform2].form.newrecord
 
Hi,

To refer to a control on a nested subform (a subform on a subform), we can
use the following syntax:

Forms![main form name]![subform control name].Form![nested subform control
name].Form![control name]

We need to pay attention to the tips/common mistakes mentioned in the
article:

ACC2000: How to Refer to a Control on a Subform or Subreport
http://support.microsoft.com/?id=209099

Please feel free to reply to the threads if you have any concerns or
questions.



Sincerely,

Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <www.microsoft.com/security>

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Zeljko Matic" <[email protected]>
| Subject: Problem with referencing subforms
| Date: Sat, 22 Nov 2003 11:20:48 +0100
| X-Tomcat-NG: microsoft.public.access.forms
|
| I'm having problems wit referencing some properties of subforms
(newrecord,
| recordsetclone.recordcount) if subform level is greater of two. For
example
| Me![Mainform]![Subform].form.newrecord work, but
| Me![Mainform]![Subform]![Subform2].form.newrecord don't work. Is there
some
| resolution.
|
| Thanks in advance
|
|
|
 
Subform1 and Subform2 are name of control that holds subform. Recourdsourec
is type error, in real example I have been using Recordsource.

Forms![Mainform]![Subform1].Form![Subform2].Form.Recordsetclone.RecordCount
Me![Subform2].Form.recordsetclone.RecordCount
Gary Miller said:
Two thoughts...

Are Subform1 and Subform2 actually the name of the subforms?
You need to reference the name of the subform 'control' that
holds the subform and not the name of the subform itself.

This may be an email typo, but I also notice that your
spelling of 'recordsourec' is repeated a couple of times. It
should be 'recordsource'.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Zeljko Matic said:
Forms![Mainform]![Subform1].Form![Subform2].Form.recordsoure
c.RecordCount
Me![Subform2].Form.recordsourec.RecordCount

In example:
I have main form Mainform, with subform Subform1 and subform of that subform
Sunform2
Mainform
Subform1
Subform2

Commands have been executing from subform Subform1.
this dont'work
Forms![Mainform]![Subform1].Form![Subform2].Form.recordsoure
c.RecordCount
Me![Subform2].Form.recordsourec.RecordCount
but
Forms![Mainform]![Subform1].Form.recordsourec.RecordCount
Me.Form.recordsourec.RecordCount works.

I have been using lot of syntax for referencing subsubform properties
newrecord or recordsource but without success. I have been using
constratction from document in attachment but without success.

Thanks in advanced!

Rick Brandt said:
I'm having problems wit referencing some properties of
subforms
(newrecord,
recordsetclone.recordcount) if subform level is
greater of two. For
example
Me![Mainform]![Subform].form.newrecord work, but
Me![Mainform]![Subform]![Subform2].form.newrecord
don't work. Is there
some
resolution.

You have to expand on the first syntax.

Me![Mainform]![Subform].form![Subform2].form.newrecord
 
Zeljko,

You probably should be checking the count of the
RecordsetClone instead of the RecordSet.

I went back and reread the thread closely and found this
line that I may have missed earlier...

"Commands have been executing from subform Subform1"

If that is the case, I would think that for the recordcount
of Subform1 from Subform1 it would be...

Me.RecordSetClone.RecordCount

To check Subform2 from Subform1...

Me.Parent!Subform2.Form.RecordsetClone.RecordCount

See if that does the trick.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Zeljko Matic said:
Subform1 and Subform2 are name of control that holds subform. Recourdsourec
is type error, in real example I have been using Recordsource.Forms![Mainform]![Subform1].Form![Subform2].Form.Recordsetcl
one.RecordCount
Me![Subform2].Form.recordsetclone.RecordCount
Two thoughts...

Are Subform1 and Subform2 actually the name of the subforms?
You need to reference the name of the subform 'control' that
holds the subform and not the name of the subform itself.

This may be an email typo, but I also notice that your
spelling of 'recordsourec' is repeated a couple of times. It
should be 'recordsource'.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Forms![Mainform]![Subform1].Form![Subform2].Form.recordsoure
c.RecordCount
Me![Subform2].Form.recordsourec.RecordCount

In example:
I have main form Mainform, with subform Subform1 and subform of that subform
Sunform2
Mainform
Subform1
Subform2

Commands have been executing from subform Subform1.
this dont'work
Forms![Mainform]![Subform1].Form![Subform2].Form.recordsoure
c.RecordCount
Me![Subform2].Form.recordsourec.RecordCount
but
Forms![Mainform]![Subform1].Form.recordsourec.RecordCount
Me.Form.recordsourec.RecordCount works.

I have been using lot of syntax for referencing subsubform properties
newrecord or recordsource but without success. I have
been
using
constratction from document in attachment but without success.

Thanks in advanced!

I'm having problems wit referencing some
properties of
subforms
(newrecord,
recordsetclone.recordcount) if subform level is greater of two. For
example
Me![Mainform]![Subform].form.newrecord work, but
Me![Mainform]![Subform]![Subform2].form.newrecord don't work. Is there
some
resolution.

You have to expand on the first syntax.

Me![Mainform]![Subform].form![Subform2].form.newrecord
 
Back
Top