Record Count

stu_c

Registered User.
Local time
Today, 18:04
Joined
Sep 20, 2007
Messages
494
Hi all
I have a form with a Tabular sub form but In the main form I want a record count in a TextBox can anyone help me with this?

Main Form - FRMMainDetails
SubForm - SFRMItems
Text Box - TXTNumberOfItems
 
Hi. Try.
Code:
=[SFRMItems].[Form].Recordset.RecordCount
Hope it helps..
 
Yes mate I did
I thought so, that means you may have had a typo, or you didn't give us the name of your subform control. So, the syntax has to be something like this:
Code:
=SubformControlName.Form.Recordset.RecordCount
The subform control name may or may not be the same as the name of the subform it contains. But if you got a Name error, then it's probably different.
 
I thought so, that means you may have had a typo, or you didn't give us the name of your subform control. So, the syntax has to be something like this:
Code:
=SubformControlName.Form.Recordset.RecordCount
The subform control name may or may not be the same as the name of the subform it contains. But if you got a Name error, then it's probably different.

hi mate
I tried it again and that was the correct name I gave you, not too sure on the issue
 
Not my actual Database but an example of it and in the same format, I want the number of items in the main form to count the number of records from the sub form
 

Attachments

Not my actual Database but an example of it and in the same format, I want the number of items in the main form to count the number of records from the sub form
Okay, sorry, I guess Recordset is not available in the Control Source anymore. Instead, I gave you a different approach. Please take a look and let me know if you have any questions.
 

Attachments

Last edited:
Okay, sorry, I guess Recordset is not available in the Control Source anymore. Instead, I gave you a different approach. Please take a look and let me know if you have any questions.

Afternoon Mate
thank you for the reply, that's kinda what I need but it seems to only update when I move onto another record and back, also is there a way for that value to be saved into the table?

I managed to do it this way cheating I know but still doesn't save to my table

In the Subform (SFRMItems) I have a
text Box named - RecordCount
with this code
Code:
=Count([ItemRecordID])

then in the main form a text back with this
Code:
=[SFRMItems].[Form]![RecordCount]
 

Users who are viewing this thread

Back
Top Bottom