I have a couple of
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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 23 years, 1 month 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
-
Have Copilot there but not taking over the screen in Word
by
CWBillow
14 minutes ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
22 hours, 35 minutes ago -
Are Macs immune?
by
Susan Bradley
19 hours, 59 minutes ago -
HP Envy and the Function keys
by
CWBillow
6 hours, 20 minutes ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
1 day, 9 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
1 day, 10 hours ago -
Unable to update to version 22h2
by
04om
41 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
1 day, 17 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
1 day, 17 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
1 day, 3 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
2 days, 6 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
1 day, 19 hours ago -
Is your battery draining?
by
Susan Bradley
6 hours, 39 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
15 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
2 days, 10 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
1 day, 18 hours ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
1 day, 18 hours ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
1 day, 11 hours ago -
National scam day
by
Susan Bradley
17 hours, 51 minutes ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
1 day, 14 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
3 days, 11 hours ago -
Tools to support internet discussions
by
Kathy Stevens
2 days ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
3 days, 2 hours ago -
AI is good sometimes
by
Susan Bradley
3 days, 18 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
3 days, 8 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
4 days, 19 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
4 days, 17 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
4 days, 21 hours ago -
Excessive security alerts
by
WSSebastian42
3 days, 12 hours ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
5 days, 7 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.