A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can’t Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2009, 09:56 PM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
[email protected]
external usenet poster
 
Posts: 24
Default Can’t Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]

Hello.

I have a form (frmRecipes) that contains a subform
(frmRecipeIngredientsSubform).

I want the total number of ingredients (in the subform) to be
displayed on the main form, so I created a text box
(txtNumberIngredients), set its format to general number, and put the
following line in the Control Source:

=[frmRecipeIngredientsSubform].[Form].[Recordset].[RecordCount]

The result returns a #Name? error, however.

What am I doing wrong? Any hints would be GREATLY appreciated
(smiles).

Jessi
  #2  
Old June 2nd, 2009, 10:12 PM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
Steve[_70_]
external usenet poster
 
Posts: 152
Default Can't Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]

Recordset should be RecordsetClone.

Steve


wrote in message
...
Hello.

I have a form (frmRecipes) that contains a subform
(frmRecipeIngredientsSubform).

I want the total number of ingredients (in the subform) to be
displayed on the main form, so I created a text box
(txtNumberIngredients), set its format to general number, and put the
following line in the Control Source:

=[frmRecipeIngredientsSubform].[Form].[Recordset].[RecordCount]

The result returns a #Name? error, however.

What am I doing wrong? Any hints would be GREATLY appreciated
(smiles).

Jessi



  #3  
Old June 2nd, 2009, 11:00 PM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
[email protected]
external usenet poster
 
Posts: 24
Default Can't Display Number of SUBFORM Items on MAIN Form... trying touse [RecordCount]

Thank you for your response, Steve.
I changed the Control Source line for the main form's textbox to
RecordsetClone as follows:
=[frmRecipeIngredientsSubform].[Form].[RecordsetClone].[RecordCount]

But I still get the #Name? error... so I'm still not doing something
right. Any ideas?
  #4  
Old June 2nd, 2009, 11:01 PM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default Can’t Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]

[email snipped] wrote in message
...
Hello.

I have a form (frmRecipes) that contains a subform
(frmRecipeIngredientsSubform).

I want the total number of ingredients (in the subform) to be
displayed on the main form, so I created a text box
(txtNumberIngredients), set its format to general number, and put the
following line in the Control Source:

=[frmRecipeIngredientsSubform].[Form].[Recordset].[RecordCount]

The result returns a #Name? error, however.

What am I doing wrong? Any hints would be GREATLY appreciated
(smiles).

Jessi


Jessi, I believe that should work if "frmRecipeIngredientsSubform" is the
name of the subform control on the main form, and provided you are using a
version of Access later than Access 97. However, it's possible that the
subform control has a different name than its Source Object form. Your
expression must use the name of the subform control, which may or may not be
the same as its Source Object. Please check the subform control to see if
you have the control's name correct.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

  #5  
Old June 2nd, 2009, 11:54 PM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
[email protected]
external usenet poster
 
Posts: 24
Default Can’t Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]

Thanks for the followup.

I have published a PICTURE of my form so you can see what I'm talking
about at the following site: http://docs.google.com/View?id=dfrm3z55_9s4scqsf9

While in Design view, I right-clicked on the subform object.
The Name property it says: frmRecipeIngredientsSubform.
The Source Object property says: frmRecipeIngredientsSubform

I am using Access 2007.

So, if I am understanding this correctly, I do have the correct name,
right? Also, I am using Access 2007.

Can you see what my problem is from the picture?

Thanks! (smiles)

Jessi
  #6  
Old June 3rd, 2009, 12:42 AM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Can’t Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]

On Tue, 2 Jun 2009 15:54:27 -0700 (PDT), wrote:

Thanks for the followup.

I have published a PICTURE of my form so you can see what I'm talking
about at the following site:
http://docs.google.com/View?id=dfrm3z55_9s4scqsf9

While in Design view, I right-clicked on the subform object.
The Name property it says: frmRecipeIngredientsSubform.
The Source Object property says: frmRecipeIngredientsSubform

I am using Access 2007.

So, if I am understanding this correctly, I do have the correct name,
right? Also, I am using Access 2007.

Can you see what my problem is from the picture?

Thanks! (smiles)

Jessi


There are two objects involved in a subform: the Subform Control (the "box" on
the mainform containing the subform) and the form object within that control.
The name of the Subform Control - the box - is what you need in the code
syntax; what you're looking at in the image on the webpage is the wrong one,
the name of the form object within that control.

View the main form's Properties, and click the *edge* of the subform. You
should see a Name property - which might be the same as the name of the form
within the control, but need not! - an also a Master Link Field and Child Link
Field property.

--

John W. Vinson [MVP]
  #7  
Old June 3rd, 2009, 01:28 AM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
[email protected]
external usenet poster
 
Posts: 24
Default Can’t Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]

OK, sirs... I have re-published the picture so you can see what I've
clicked on to view the properties: http://docs.google.com/View?id=dfrm3z55_11cx28xtf7

I viewed the main form's properties, then clicked on the edge of the
subform... I see a box, and the name is frmRecipeIngredientsSubform.
(Please note that if I clicked the box beside the ruler in the first
picture, the Record Source is tbleRecipeIngredients, but I don't think
this is what I need, right?)

Am I still way off the mark? (sighs).

Thanks,
Jessi
  #8  
Old June 3rd, 2009, 01:45 AM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Can’t Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]

On Tue, 2 Jun 2009 17:28:52 -0700 (PDT), wrote:

OK, sirs... I have re-published the picture so you can see what I've
clicked on to view the properties:
http://docs.google.com/View?id=dfrm3z55_11cx28xtf7

I viewed the main form's properties, then clicked on the edge of the
subform... I see a box, and the name is frmRecipeIngredientsSubform.
(Please note that if I clicked the box beside the ruler in the first
picture, the Record Source is tbleRecipeIngredients, but I don't think
this is what I need, right?)

Am I still way off the mark? (sighs).

Thanks,
Jessi


OK, I've missed a big part of this discussion. It sounds like you've got the
right subform reference but since I don't know the context (or the problem for
that matter!) I'm not sure what problem you're having. I tried both google
groups and www.bing.com to see, but neither turns up your prior messages.

What's going on?
--

John W. Vinson [MVP]
  #9  
Old June 3rd, 2009, 01:55 AM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
[email protected]
external usenet poster
 
Posts: 24
Default Can’t Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]

Sure! I have copied and pasted my previous question for your
review... thanks!:

I have a form (frmRecipes) that contains a subform
(frmRecipeIngredientsSubform).

I want the total number of ingredients (in the subform) to be
displayed on the main form, so I created a text box
(txtNumberIngredients), set its format to general number, and put the
following line in the Control Source:

=[frmRecipeIngredientsSubform].[Form].[Recordset].[RecordCount]

The result returns a #Name? error, however.

What am I doing wrong? Any hints would be GREATLY appreciated
(smiles).

Jessi
______________

Please note that after I printed this message, a gentleman told me to
change the command to "RecordsetClone".... which, I did, but I still
get the same #Name? error, so I am doing something else wrong I guess.
______________

Thanks so much for your patience and endurance (laughs!).

Jessi
  #10  
Old June 3rd, 2009, 02:00 AM posted to microsoft.public.access.forms,microsoft.public.access.gettingstarted
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default Can’t Display Number of SUBFORM Items on MAIN Form... trying to use [RecordCount]

wrote in message
...
Thanks for the followup.

I have published a PICTURE of my form so you can see what I'm talking
about at the following site:
http://docs.google.com/View?id=dfrm3z55_9s4scqsf9

While in Design view, I right-clicked on the subform object.
The Name property it says: frmRecipeIngredientsSubform.
The Source Object property says: frmRecipeIngredientsSubform

I am using Access 2007.

So, if I am understanding this correctly, I do have the correct name,
right?


It sure sounds like it.

Also, I am using Access 2007.


I've done this with earlier versions of Access, but haven't yet tested with
A2007. It could be a question of either of a couple of security settings:
whether VBA code is allowed, or whether you have Jet Sandbox Mode turned on
(which it is by default).

Does VBA code run in this database? Is it in a trusted location? Do you
have Sandbox Mode enabled?

I'll do some tests with Access 2007, though it's not my main development
environment.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:47 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.