Record counter gives wrong answer

Creating tables and queries

Record counter gives wrong answer

Postby MikeytheMagnificent » Tue Sep 29, 2009 11:27 pm

If I open seemingly any old table in table view with more than a pageful of records say 203, the record counter at the bottom of the screen announces
"record 1 of 33"
where the screen is displaying about 31 records, why??. As I spin the mousewheel down the records the number of records keeps updating by 3 then after a few of those by 30, then by some other seemingly random number until the final 30 records come into view. Once the actual final and correct count is displayed all is ok until the table is closed and all the miscounting starts again
If I then design a couple of quick forms one as a table the other as sequential records, in both cases random misreporting occurs by different multiples until the last record has been viewed to correct the count

Why? What? How? Can I cope? please!
I thought this would have been Topic-ed years back, but see no mention on the boards, at least not where I'm looking.

Thanks for being patient
Many opportunities to add short Tutorials or faq's are missed

1. Must have obvious title to be found easily
2. Keep to objectives
3. Use very clear language
4. Difficult to get right
5. Rewards are few
User avatar
MikeytheMagnificent
 
Posts: 137
Joined: Fri Apr 11, 2008 12:06 am
Location: W. Yorks UK

Re: Record counter gives wrong answer

Postby TheGurkha » Tue Sep 29, 2009 11:50 pm

This is pretty standard for this type of database program. Until the file has been traversed it doesn't know how many records are in the file.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
User avatar
TheGurkha
Volunteer
 
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Record counter gives wrong answer

Postby MikeytheMagnificent » Wed Sep 30, 2009 12:29 am

Thanks Gurkha,
It knows correctly from the moment the last record fits onto the visible screen, whether or not any clicking has gone on, is there a slick way of auto-forcing the record counter to self correct if the Viewer Object is a Form? say?
I've no idea but can I just
View Last>View First
automatically by Macro or somewayelse?
It may be important not to display barefaced lies by default :oops:
Many opportunities to add short Tutorials or faq's are missed

1. Must have obvious title to be found easily
2. Keep to objectives
3. Use very clear language
4. Difficult to get right
5. Rewards are few
User avatar
MikeytheMagnificent
 
Posts: 137
Joined: Fri Apr 11, 2008 12:06 am
Location: W. Yorks UK

Re: Record counter gives wrong answer

Postby TheGurkha » Wed Sep 30, 2009 1:24 pm

You might be able to do this by going to the last record and back again, using a macro, but I'm not sure. And I don't know OOo macro stuff yet.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
User avatar
TheGurkha
Volunteer
 
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Record counter gives wrong answer

Postby eremmel » Wed Sep 30, 2009 7:59 pm

There is also an issue with definition. Does the record numbers reflect the information in the database or just the records loaded by the form? I think it is the latter. It might become more intuitive when you consider the fact that when you apply a filter via the 'data table' or 'form navigation' bar the amount of records reflects the filter condition. Note that there is always an * behind the 'total' or 'of count' record number when not all records are fetched. With this in mind is the information on the form still sometimes a lie?
Is your question answered: edit your initial post add "[Solved]" to the subject and check V
LO4.2.8 for work with ORB; AOO4.1.4,LO5.2.5/6.0.5 on W7E SP1 64bit
It's Microsoft marketing that tells you computers are qualified for non-technicians
User avatar
eremmel
Volunteer
 
Posts: 1020
Joined: Tue Dec 30, 2008 1:15 am
Location: Barneveld, Netherlands

Re: Record counter gives wrong answer

Postby MikeytheMagnificent » Thu Oct 01, 2009 12:14 pm

Thanks Ghurka you pointed me in exactly the right direction, but please don't lose faith yet!

and thanks eremmel for keeping this thread alive and advice . Sorry but I lost your drift in the last couple of lines

Its too important to let it die. Not only is it important that We all know about this problem it can be dangerous if at a glance we are told and expect a table or form to contain a pageful of records (about 30) when it actually contains '00s or '000s our viewing stacks the odds a certain way and we may go out and bet our shirt on a three legged donkey.

First time ever, I set up and open a form in which I record a macro, by mousing to the last record (click), then immediately back to the first (click), which updates the record counter to read record 1 of 243, great, but how do I automate and amalgamate the form-open part with the auto-clicky part, because until I get a form open, I can't record another macro (at primary level like me). to open itself and then to carry on and run the one that's working already.
Ah! since I can't do it directly, because the form design button is greyed, I must close it and use the form-edit doo daa in the main database window, where I click the toolbar button marked "form" which reveals not a "record macro" possibility but 3 tabs, from which the events tab makes available a "when loading" event to which I attach ... my update-records macro
Many opportunities to add short Tutorials or faq's are missed

1. Must have obvious title to be found easily
2. Keep to objectives
3. Use very clear language
4. Difficult to get right
5. Rewards are few
User avatar
MikeytheMagnificent
 
Posts: 137
Joined: Fri Apr 11, 2008 12:06 am
Location: W. Yorks UK

Re: Record counter gives wrong answer

Postby MikeytheMagnificent » Thu Oct 01, 2009 12:33 pm

sorry but this intolerant text editor's got me again :crazy: and dumped my last paragraph of my last post :crazy:

I went on to say "How can I now track back even further" and exclude my viewers from almost everywhere, by setting up preferably a desktop shortcut directly to my corrected form or to a control panel or dashboard.

No geeky "Writer" menuy toolbary status bar stuff or "Base" main window stuff. Just a shoebox on the desktop called "Mikeys Magnificent Moneymaking System" "Press the Button to continue"
Many opportunities to add short Tutorials or faq's are missed

1. Must have obvious title to be found easily
2. Keep to objectives
3. Use very clear language
4. Difficult to get right
5. Rewards are few
User avatar
MikeytheMagnificent
 
Posts: 137
Joined: Fri Apr 11, 2008 12:06 am
Location: W. Yorks UK

Re: Record counter gives wrong answer

Postby eremmel » Thu Oct 01, 2009 1:57 pm

I like to continue with you the discussion. The records number is not the amount of records in the database. It is only the number of records *loaded* by the form. When more records can be loaded it is indicated with a '*' as in the following below.
Records.png
Record counter without an with all records loaded from database
Records.png (9.84 KiB) Viewed 5224 times
. When I apply a filter on my data, I limit the amount of records that I can view in my form. So the total amount of records is than lower. See second picture.
FilteredRecords.PNG
Total number of records in form when a filter is active.
FilteredRecords.PNG (1.21 KiB) Viewed 5224 times
This is also implicitly the case when you do have a SQL query as source for your form. The where clause contains a filter condition. Esp for larger data sets and complex filter conditions, the 'goto the last records and back' action can make loading of a form very time consuming (It might take minutes to open a form).
Is your question answered: edit your initial post add "[Solved]" to the subject and check V
LO4.2.8 for work with ORB; AOO4.1.4,LO5.2.5/6.0.5 on W7E SP1 64bit
It's Microsoft marketing that tells you computers are qualified for non-technicians
User avatar
eremmel
Volunteer
 
Posts: 1020
Joined: Tue Dec 30, 2008 1:15 am
Location: Barneveld, Netherlands

Re: Record counter gives wrong answer

Postby MikeytheMagnificent » Thu Oct 01, 2009 4:46 pm

Sorry, I never noticed the * before, you very clever Dutchman

So how do I control the record loading, for me it just loads a screenful, give or take a couple!
Are you saying that if I load via sql and filter I can regain control and turbo the loading?

In my case it is only the record count that matters right now. My form has no fields displayed just yet, so the current record number is meaningless. I hide the default record selector/counter together with the VCR navigator and desire to show a custom version instead, all that matters is that it is correct!! :super: but where do I aquire one? :knock: Is it a OOBasic job from my existing macro or what?

If all else fails, Presumably a report will give me access to a COUNT function, but I'm wanting a form, which I know is close, but is it close enough?
so far I can't even get SRB to work and the internal report wizard never even loads
Many opportunities to add short Tutorials or faq's are missed

1. Must have obvious title to be found easily
2. Keep to objectives
3. Use very clear language
4. Difficult to get right
5. Rewards are few
User avatar
MikeytheMagnificent
 
Posts: 137
Joined: Fri Apr 11, 2008 12:06 am
Location: W. Yorks UK

Re: Record counter gives wrong answer

Postby eremmel » Thu Oct 01, 2009 9:00 pm

If you are only interested in the record count, make one yourself by adding a sub-form with a query that counts the records e.g.:
Code: Select all   Expand viewCollapse view
SELECT COUNT(*) AS "Records" FROM "<your-table-name>"
Add a numeric field to this sub-form and assign the data-field "Records" to the control.
Here is the result I got:
RecordsField.PNG
A counter field as the result of a query attached to a subform
RecordsField.PNG (1.85 KiB) Viewed 5209 times
. Use the the "FormNavigator" shows to add a sub form to the Mainform. Add a number and lable field drag/drop those to the sub-form with help of the navigator. Here is an example of the structure:
RecordCounterForm.PNG
Form structure
RecordCounterForm.PNG (13.41 KiB) Viewed 5209 times
Is your question answered: edit your initial post add "[Solved]" to the subject and check V
LO4.2.8 for work with ORB; AOO4.1.4,LO5.2.5/6.0.5 on W7E SP1 64bit
It's Microsoft marketing that tells you computers are qualified for non-technicians
User avatar
eremmel
Volunteer
 
Posts: 1020
Joined: Tue Dec 30, 2008 1:15 am
Location: Barneveld, Netherlands


Return to Tables & Queries

Who is online

Users browsing this forum: No registered users and 4 guests