473,473 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Wrong record count

6 New Member
Hello

In my form load event, I have the value of a text box that displays the count of the records in the form. The number always displays 40, where a physical count of the records is 73.

Expand|Select|Wrap|Line Numbers
  1. Me.Text7.Value = [Forms]![frm_All_Mattresses_Main].[frm_All_Matt_frm_subform].Form.Recordset.RecordCount
  2.  
Any suggestions?

Thank you
Terry
Oct 30 '09 #1
4 9811
ChipR
1,287 Recognized Expert Top Contributor
This behavior is explained clearly with the solution in this link: Recordset.RecordCount Property.
Oct 30 '09 #2
ADezii
8,834 Recognized Expert Expert
@Terryvanduzee
You can also use DCount("*") on the Record Source of the Sub-Form with a Where criteria rto obtain an accurate Count.
Oct 30 '09 #3
NeoPa
32,556 Recognized Expert Moderator MVP
When Recordsets are opened, it's not always practical to read the whole dataset into memory at the outset. It is not always necessary and takes up valuable resources. When you try to get the count of the records before they're all loaded in, the value is inaccurate (as you've found). The solution to this is to move the recordset pointer (or current record) to the end and then back to the start. This ensures all records are loaded and the correct count value is returned. Be careful only to do this in situations where you're confident that the recordset is not too large though. The delay can make for a quite unfriendly user experience if it is.
Oct 31 '09 #4
Terryvanduzee
6 New Member
Thank you...
Works great. I had forgotten about the movelast

Again, thank you
Terry
Nov 2 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
3
by: thomasp | last post by:
I am trying to get a record count of a PHP query on a MS Acess database using ODBC with a DSN for MS ACCESS connection. I got this code from the PHP manual user notes. It seems to return the...
1
by: Ryan | last post by:
I've got a problem I have't run up against before. I generally test for an empty recordset using BOF and EOF. Today, for the first time I ran into a problem where my recordset shows BOF and EOF =...
1
by: darrel | last post by:
I'm trying to whip up a fancy repeater control that will put records into a two-column table for me. This is how I envision it working: itemtemplate if record count = odd then write out the...
2
by: salih ataoz | last post by:
in visual basic 6 rst.recordcount shows us how many records are there in rst but in studio .net i dont konw ho to learn recordcount the code is like this cnn.Open() Dim cmd As OleDbCommand...
7
by: Mike | last post by:
I have a form where I have turned off the default navigation buttons. I then created my own. This works fine. The only questions that I have is on the default navigation buttons it shows total...
4
by: Peter W Johnson | last post by:
Hi guys, I have a problem with a datagrid record count. Here is the code:- <snip> Public Class frmMerchantDeposit Inherits System.Windows.Forms.Form Dim myconnection As New...
7
by: hjohnson | last post by:
Within the access environment, I have a table that I'd like to -add a column -place the record number of each record into that column The autonumber is not working for me because I am...
2
by: John | last post by:
Hi I am using the below statement; Me.MyTableAdapter.Fill(Me.MyDataSet.tblMyTable) How can I now check the record count of the data table and specifically if the record count returned by...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.