I have a couple of
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
DCount, A97 to A2K difference? (A2K)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » DCount, A97 to A2K difference? (A2K)
- This topic has 8 replies, 4 voices, and was last updated 22 years, 11 months ago.
Viewing 0 reply threadsAuthorReplies-
WSdcardno
AskWoody LoungerMay 16, 2002 at 4:20 pm #588430Well – I’ve narrowed down the problem – although that isn’t getting me any closer to the solution. The problem is definitely in the text box that uses the DCount function to determine how many proposals have been presented by each company (or their affiliates). Everything works without a hitch if I remove that text box.
With the text box (and the DCount) in place the problem seems to be related to the length of the data in the company name field (used in the DCount criteria) for that record. Yesterday (when I was having problems) it was 134 characters long. The function works properly when I edit the company name down to 125 characters – but that doesn’t match the name we are using on the contract – and it would be kind of nice if our records matched our contracts!
As I noted yesterday, this problem only shows up in A2K: A97 seems fine with the long(er) name. Does anyone know if there is a limit on how long the criteria string can be in DCount, and if this limit was reduced between A97 and A2K?
Does anyone have any ideas for a workaround? Right now I am thinking of writing a new query based on the query that supplies data to the subform, with the criteria to be matched in the query (which would be the same as the master link field for the subform), and then just displaying a text box with a DCount of all the records returned in that query. Is there a way to count the number of records on a subform directly, other than by including a count function in a subform header or footer (I don’t really want to waste the space on the subform, although that is another option if I can juggle the layout a bit….)
-
WSpatt
AskWoody LoungerMay 16, 2002 at 7:04 pm #588457I had a similar problem in A97 with a long text name I was using in an index, it would seemingly lose records from the subform (the text field was part of a main form). I found that users were putting carriage returns in the text field and this seemed to be causing all sorts of problems. Also my problem was with text strings approaching 255 characters, not the 128 (magic number) as you have.
What I did in the end was to use a autonumber field to identify the text field and to use this in the index instead, and all my problems went away.
Another problem I had with using a text field in an index (so long) was that I had about 4 tables that were using this as part of the index thereby making the index size very large indeed. It seems that one should try and keep the index size as small as you can.
HTH
Pat. -
WSdcardno
AskWoody LoungerMay 16, 2002 at 7:15 pm #588460Hi Pat – thanks for your comments.
I have moved things around a bit on the form and subform and included a textbox with an “=count(*)” data source in the subform header. Fortunately the two other places in the database where I indicate the number of subform records are not running into trouble because the criteria fields they refer to are much shorter – 20-30 characters at most, although the field is set as maximum 255 characters – I still don’t think it will be a problem since this was a special case due to the legal description of the joint venture we were dealing with.
I had thought of going back and using an autonumber field for the criteria – but changing the form and subform layout was simpler than tearing up the existing database to put in a new key field…
-
WScharlotte
AskWoody LoungerMay 17, 2002 at 2:21 am #588535If all you want to do is display the number of records in the subform, why are you using a DCount in the first place? You can open a recordsetclone on the subform, movelast, and get the recordcount. I use something like that in the Current event of subforms when I want to present that information but I don’t want to use the built in navigation tools.
-
WSdcardno
AskWoody LoungerMay 18, 2002 at 2:43 am #588782The short answer is that I didn’t know how to do that until I read your message!
Will the recordsetclone reflect the master-child link between the form and the subform? I’ll have a whack at it over the weekend – thanks for the tip.
I had a workaround of including a =count(*) textbox on the subform header, and *that* works, but I think there is a more fundamental problem: it seems that Access is very skittish about indexing (I think that is were the problem lies) fields with (text) data elements longer than 128 characters.
Everything works in my application, if I construct reports to not include this particular record (I have a bunch of pre-set reports that show companies by location, etc – by reporting on locations that don’t include this “long name” outfit I can see that everything else works). As soon as I include them on a report (which is sorted by company name, Access freezes up.
Coincident with inputting this long company name, I upgraded Jet 4.0 with sp6 – I don’t know if the problems occurred before or after I upgraded, and can’t recall whether I had this company entered before the upgrade, and if I ran reports that would include them at that time. I am quite mystified, since the whole thing works properly in A97….
-
WBell
AskWoody_MVPMay 18, 2002 at 12:27 pm #588802Yesterday it seems to me that somewhere I read that if you index a text field an index will only use the first 128 characters, but I’ve just spent half an hour looking for it and didn’t find it. In any event, that sounds like a possible link to the problem you are having. Rereading your post, it would probably be a better design to put some sort of numerical key and use that as your lookup, rather than using the text string as your key. Or have I misunderstood your post? One other question – what Service Release of Access 2000 are you using? I ask because if you don’t have at least SR1, there were numberous bugs in 2000. OK, I guess there is another question too. Did you have Access 2000 convert the 97 database, or did you do an import into a clean A2k database? Converted databases have a checkered history at best.
-
WScharlotte
AskWoody LoungerMay 18, 2002 at 3:21 pm #588814That’s one of the nice things about the recordsetclone–it reflects the available records in the recordset. You have to set the recordsetclone on the *subform*, then it will reflect only the records that are allowed by the master/child links.
I haven’t had any problems with the SP6 update to Jet 4.
I agree with Wendell though on that *long* string. It’s much more efficient to search on a numeric index.
-
WSdcardno
AskWoody LoungerMay 19, 2002 at 4:17 pm #588911Wendell and Charlotte – thank you both for your comments. The “Company” table is set up with an autonumber key field – but through inexperience I sometimes used the numeric key field and sometimes the text ‘name’ field for my links to other tables or in queries
I am not really excited about going back and changing all the links to be consistent – but that’s probably the right way to correct this. I am hopeful that it will improve performance overall – at least that way I can rationalize it as ‘an improvement’ rather than ‘a correction’ – but that’s just a little mind-game!
Wendell asked about the file conversion. This file is a front end converted from A97 to A2K – the office is standardized on A97, but my home computer is on A2K. In order to work on the file at home I convert between the two, and periodically copy and convert the back end just so I have up-to-date data to test it against, although the back-end file now includes examples of just about every type of data element I am likely to encounter so keeping my converted back end up to date is no longer as big an issue.
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Steps to take before updating to 24H2
by
Susan Bradley
1 hour, 46 minutes ago -
Which Web browser is the most secure for 2025?
by
B. Livingston
1 hour, 47 minutes ago -
Replacing Skype
by
Peter Deegan
1 hour, 48 minutes ago -
FileOptimizer — Over 90 tools working together to squish your files
by
Deanna McElveen
1 hour, 49 minutes ago -
Excel Macro — ask for filename to be saved
by
nhsj
5 hours, 12 minutes ago -
Trying to backup Win 10 computer to iCloud
by
SheltieMom
1 day, 2 hours ago -
Windows 11 Insider Preview build 26200.5570 released to DEV
by
joep517
1 day, 16 hours ago -
Windows 11 Insider Preview build 26120.3941 (24H2) released to BETA
by
joep517
1 day, 17 hours ago -
Windows 11 Insider Preview Build 22635.5305 (23H2) released to BETA
by
joep517
1 day, 17 hours ago -
No April cumulative update for Win 11 23H2?
by
Peobody
5 hours, 53 minutes ago -
AugLoop.All (TEST Augmentation Loop MSIT)
by
LarryK
1 day, 18 hours ago -
Boot Sequence for Dell Optiplex 7070 Tower
by
Serge Carniol
2 days, 9 hours ago -
OTT Upgrade Windows 11 to 24H2 on Unsupported Hardware
by
bbearren
2 days, 13 hours ago -
Inetpub can be tricked
by
Susan Bradley
20 hours, 29 minutes ago -
How merge Outlook 2016 .pst file w/into newly created Outlook 2024 install .pst?
by
Tex265
1 day, 6 hours ago -
FBI 2024 Internet Crime Report
by
Alex5723
2 days, 16 hours ago -
Perplexity CEO says its browser will track everything users do online
by
Alex5723
1 hour, 54 minutes ago -
Login issues with Windows Hello
by
CWBillow
3 days, 3 hours ago -
How to get into a manual setup screen in 2024 Outlook classic?
by
Tex265
2 days, 15 hours ago -
Linux : ARMO rootkit “Curing”
by
Alex5723
3 days, 15 hours ago -
Employee monitoring app leaks 21 million screenshots in real time
by
Alex5723
3 days, 15 hours ago -
Google AI is now hallucinating idioms
by
Alex5723
3 days, 16 hours ago -
april update
by
69800
1 day, 20 hours ago -
Windows 11 Insider Preview build 27842 released to Canary
by
joep517
3 days, 17 hours ago -
Quick Fix for Slowing File Explorer
by
Drcard:))
3 days, 17 hours ago -
WuMgr not loading?
by
LHiggins
2 days, 12 hours ago -
Word crashes when accessing Help
by
CWBillow
3 hours, 9 minutes ago -
New Microsoft Nag — Danger! Danger! sign-in to your Microsoft Account
by
EricB
3 days, 16 hours ago -
Blank Inetpub folder
by
Susan Bradley
3 days, 14 hours ago -
Google : Extended Repair Program for Pixel 7a
by
Alex5723
4 days, 3 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.