Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Re: access digest: February 27, 2003


Message #1 by Dr P Singh <psinghp@e...> on Fri, 28 Feb 2003 13:32:27 +0400
>
>
>Subject: Re: Current Record Number
>From: Beth Moffitt <BethMoffitt@i...>
>Date: Thu, 27 Feb 2003 08:52:10 -0600
>X-Message-Number: 17
>
>I like to use the following for total number of records in a recordset:
>
>On the form place a text box called RecCount  
>On Form_Current use:
>    
>Me.Dynaset.MoveLast
>Me!RecCount = Me.Dynaset.RecordCount & " Records"
>
>The text box will display the total number of records in the recordset.
>
>Beth 
>
>  
>
Hi Beth,

I am trying to determine the no of records in my subform. I can get the 
total number of record in the databse simply by using 
 Dynaset.RecordCount. However, any attempt to get the number of records 
displayed in the subform gives error #Error.

This is my setup. Acces 2002, win98 SE.

I have a form where have a drop down box for month (Jan, 
Feb.............Dec) . Depending on which month is selcted the subform 
(sbfTest) dispalys the entry corresponding to the selected month. I have 
a text box and have set the source control to

=sbfTest.[Dynaset].RecordCounts]
or
=Count ([sbfTest].[Name])
where Name is one of the field being displayed

By seting the source Control to

=[sbfTest].{Name] does display the name corresponding to selected row in 
the subform, however, attempt to cout the total number of records being 
displayed gives error either #error or #name

TLIA

Prabhu


I have tried setting control sou

Message #2 by "Gregory Serrano" <SerranoG@m...> on Fri, 28 Feb 2003 13:17:16
Beth & Maha,

<< I like to use the following for total number of records in a recordset:

On the form place a text box called RecCount  
On Form_Current use:
    
Me.Dynaset.MoveLast
Me!RecCount = Me.Dynaset.RecordCount & " Records"

The text box will display the total number of records in the recordset.

Beth 


Hi Beth,

I am trying to determine the no of records in my subform. I can get the 
total number of record in the databse simply by using Dynaset.RecordCount. 
However, any attempt to get the number of records displayed in the subform 
gives error #Error. >>

True that the .RecordCount property will get the number of records, but 
you still have to declare the variables, define the recordsets, etc.  That 
takes many lines of code.  Why not simply use one line of code?  Namely:

   Me.RecCount = DCount("[Primary Key]", "tblMyTable", _
                 "[Primary Key] Is Not Null") 


That's it... one line.

Greg
Message #3 by Beth Moffitt <BethMoffitt@i...> on Fri, 28 Feb 2003 08:44:00 -0600

Hi Greg,

As I'm sure you know, in Access there is more than one way to do things.
Doesn't mean one is right and the other is wrong (well, in some cases that
may be true), it just means that the app is flexible in how to handle
different situations.

Regards,

Beth 

-----Original Message-----
From: Gregory Serrano [mailto:SerranoG@m...] 
Sent: Friday, February 28, 2003 7:17 AM
To: Access
Subject: [access] Re: access digest: February 27, 2003

Beth & Maha,

<< I like to use the following for total number of records in a recordset:

On the form place a text box called RecCount  
On Form_Current use:
    
Me.Dynaset.MoveLast
Me!RecCount = Me.Dynaset.RecordCount & " Records"

The text box will display the total number of records in the recordset.

Beth 


Hi Beth,

I am trying to determine the no of records in my subform. I can get the 
total number of record in the databse simply by using Dynaset.RecordCount. 
However, any attempt to get the number of records displayed in the subform 
gives error #Error. >>

True that the .RecordCount property will get the number of records, but 
you still have to declare the variables, define the recordsets, etc.  That 
takes many lines of code.  Why not simply use one line of code?  Namely:

   Me.RecCount = DCount("[Primary Key]", "tblMyTable", _
                 "[Primary Key] Is Not Null") 


That's it... one line.

Greg
Message #4 by Beth Moffitt <BethMoffitt@i...> on Fri, 28 Feb 2003 08:48:35 -0600
For subforms, I tell Navigation Buttons 'Yes' which provides the count!
Easy way to do something and no coding!

-----Original Message-----
From: Dr P Singh [mailto:psinghp@e...] 
Sent: Friday, February 28, 2003 3:32 AM
To: Access
Subject: [access] Re: access digest: February 27, 2003

Hi Beth,

I am trying to determine the no of records in my subform. I can get the 
total number of record in the databse simply by using 
 Dynaset.RecordCount. However, any attempt to get the number of records 
displayed in the subform gives error #Error.

This is my setup. Acces 2002, win98 SE.

I have a form where have a drop down box for month (Jan, 
Feb.............Dec) . Depending on which month is selcted the subform 
(sbfTest) dispalys the entry corresponding to the selected month. I have 
a text box and have set the source control to

=sbfTest.[Dynaset].RecordCounts]
or
=Count ([sbfTest].[Name])
where Name is one of the field being displayed

By seting the source Control to

=[sbfTest].{Name] does display the name corresponding to selected row in 
the subform, however, attempt to cout the total number of records being 
displayed gives error either #error or #name

TLIA

Prabhu


I have tried setting control sou


  Return to Index