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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
#7
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|