Record counter not reflecting actual records

Raystorm

New member
Local time
Today, 08:01
Joined
Nov 20, 2007
Messages
9
Hi all, I've got a problem with a form that I've created. If I enter data into it, the record counter with the navigation buttons reflects the number of records in the database. However, if I close the form and re-open it, the record counter resets itself to record 1 of 1 again. However, the Autonumber that I'm using as a key does reflect the correct value in the tables. It's as if there's a disjoint between the form and the tables. Can anyone give me any suggestions as to what the problem is?
 
Do you have the form's DATA ENTRY property set to YES? That would do it to you.
 
OK, I've set Data Entry to YES now, but it's still showing 1 of 1 record when I've got around 10 records in the database.
 
No, I meant it should be NO. Data Entry mode will show 1 of 1 and then when you enter it will go 1 of 2, 1 of 3, etc.

Can you post your db?
 
I'm a little confused by your narration of events.

If I enter data into it, the record counter with the navigation buttons reflects the number of records in the database. However, if I close the form and re-open it, the record counter resets itself to record 1 of 1 again.

It sounds as if the number of records showing in the nav buttons changes from 1 to the total number of records. Exactly when does this happen? You also don't say how these forms are being opened, i.e. in Edit Mode, in Data Entry Mode, in Read-Only Mode?

Something to remember; the Record Number reflects the number of records in the current recordset, not in the underlyingtable/query! When a form is opened with the Data Entry Property set to Yes, for example, the nav tools will show Record 1 of 1 because that's the number of records in the current recordset! There are existing records in the underlying table/query, but there no existing records in this recordset!

Linq

Sorry, didn't see you there, Bob! Got disturbed mid-reply by Puck the Magic Chow Hound!
 
Hi, sorry for not being clear enough! I'm using the form in Data Entry mode. I've now changed Data Entry to NO, but the problem is still there. How would I go about making the nav tools show the number of records in the underlying table rather than the current recordset?
 
Well, you aren't going to get that from the navigation buttons on the form. For that you would need a quick DCount in a text box:

Set this as the control source: =DCount("[YourFieldNameHere]","YourTableNameHere")

But, you won't have the 1 of 10, etc. part; just the total number of records in the table.
 
Ah, I see now. I think perhaps that I'm approaching this the wrong way. I've used forms in the past that allow you to use the navigation buttons to go backwards and forwards through the records in the database, and also add new records via the form. How would I go about doing this? Would I need to setup some sort of query to do this?
 
Ah, I see now. I think perhaps that I'm approaching this the wrong way. I've used forms in the past that allow you to use the navigation buttons to go backwards and forwards through the records in the database, and also add new records via the form. How would I go about doing this? Would I need to setup some sort of query to do this?

That's what I do too, but if you want all records to show up, you need to use a query of

SELECT * FROM YourTableNameHere

and that will pull all records and then you need to make sure that the Data Entry property is set to NO.
 
Thank you Bob, I take it that this query would go in the Record Source property of the form? However, the form I'm using takes data from a number of different tables. Would this affect any of the other fields in the form?
 
Yes, that would. So, you would still need to set the recordsource to whatever recordsource you need (query including applicable fields from applicable tables) and again that will show you the number of records from that QUERY and not a specific table.

If you want the specific table then you might consider using a subform for each table and linking the Master / Child links together appropriately.
 
Hi,
try this, if u want: in properties (ur form) -> tab "Event" -> "On Open" type "DoCmd.GoToRecord , , acNewRec"
 
Thanks Bob, so just to be clear, the steps would be 1. Create Query with all the fields that I want to show in the form in 2. Point a form at that query?
 
Thank you Bob, I'll try building a query tomorrow and then building a form around that and see how I get on. I've looked at some forms in other databases that work in the way that I want, and they work in this way.
 

Users who are viewing this thread

Back
Top Bottom