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 22 years, 10 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
-
Windows 11 Insider Preview build 26200.5518 released to DEV
by
joep517
8 hours, 11 minutes ago -
Windows 11 Insider Preview build 26120.3671 (24H2) released to BETA
by
joep517
8 hours, 12 minutes ago -
Forcing(or trying to) save Local Documents to OneDrive
by
PateWilliam
17 hours, 5 minutes ago -
Hotpatch for Windows client now available (Enterprise)
by
Alex5723
5 hours, 1 minute ago -
MS-DEFCON 2: Seven months and counting
by
Susan Bradley
54 minutes ago -
My 3 monitors go black & then the Taskbar is moved to center monitor
by
saturn2233
1 day, 2 hours ago -
Apple backports fixes
by
Susan Bradley
8 hours, 35 minutes ago -
Win 11 24H2 will not install
by
Michael1950
56 minutes ago -
Advice to convert MBR to GPT and install Windows 11 Pro on unsupported PC
by
Andy M
9 minutes ago -
Photos from iPhone to Win 10 duplicating/reformatting to .mov
by
J9438
13 hours, 24 minutes ago -
Thunderbird in trouble. Here comes Thundermail
by
Alex5723
1 day, 4 hours ago -
Get back ” Open With” in context menus
by
CWBillow
1 day, 16 hours ago -
Many AMD Ryzen 9800X3D on ASRock have died
by
Alex5723
8 hours, 53 minutes ago -
simple general stupid question
by
WSaltamirano
1 day, 14 hours ago -
April 2025 Office non-Security updates
by
PKCano
2 days, 7 hours ago -
Microsoft wants to hear from you
by
Will Fastie
1 day, 7 hours ago -
Windows 11 Insider Preview Build 22635.5160 (23H2) released to BETA
by
joep517
2 days, 11 hours ago -
Europe Seeks Alternatives to U.S. Cloud Providers
by
Alex5723
2 days, 16 hours ago -
Test post
by
Susan Bradley
2 days, 19 hours ago -
Used Systems to delete Temp files Gone WRONG what does this mean?
by
Deo
2 days, 20 hours ago -
SSD shuts down on its own
by
CWBillow
2 days, 12 hours ago -
OneDrive File Sharing Changes
by
David Clark
3 days, 4 hours ago -
OneDrive File Sharing Changes
by
David Clark
3 days, 6 hours ago -
Win 10 Pro 22H2 to Win 11 Pro 23H2 Conversion Guide
by
doneager
2 days, 6 hours ago -
Today is world backup day
by
Alex5723
2 days, 22 hours ago -
Windows .exe on Mint
by
Slowpoke47
8 hours, 52 minutes ago -
Reviewing your licensing options
by
Susan Bradley
16 hours, 50 minutes ago -
Apple has been analyzing your photos since September 2024
by
B. Livingston
6 hours, 41 minutes ago -
What Windows 11 24H2 offers beyond bugs
by
Lance Whitney
1 day, 23 hours ago -
Making sense of Settings in Windows 11
by
Simon Bisson
2 days ago
Recent blog posts
- MS-DEFCON 2: Seven months and counting
- Apple backports fixes
- April 2025 Office non-Security updates
- Microsoft wants to hear from you
- Reviewing your licensing options
- Apple has been analyzing your photos since September 2024
- What Windows 11 24H2 offers beyond bugs
- Making sense of Settings in Windows 11
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.