I have an Access 2000 database which works perfectly on my PC (Windows 98) – however when I load it onto a PC using Windows 2000 or NT I get a message saying that there are function errors and do I want to debug. I know the functions work fine – how do I tell this to the PC with Windows 2000/NT?
![]() |
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 |
-
Functions don’t work in Windows 2000 (Access 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Functions don’t work in Windows 2000 (Access 2000)
- This topic has 21 replies, 5 voices, and was last updated 21 years, 5 months ago.
Viewing 1 reply threadAuthorReplies-
WBell
AskWoody_MVP -
WScw2
AskWoody LoungerDecember 31, 2003 at 1:47 pm #762950I tried that already – my first thoughts were that the reference libraries were not the same but I have change them.
stdole2.tlb is the only one that has a different file location on Windows 2000
c:wnttsystem32stdole2.tlb as opposed to c:windowssystemstdole2.tlb
This might explain why the database might not be able to find objects but I am not sure about functions.The other reference libraries are VBE6.dll, MSACC9.OLB, SSADO15.dll and these are all in the same location in Windows 2000 PCs
Could it have anything to do with whether it is a private function, function or public function or other?
-
WScharlotte
AskWoody Lounger -
WScharlotte
AskWoody Lounger
-
-
WSpatt
AskWoody Lounger-
WScw2
AskWoody Lounger -
WSHansV
AskWoody LoungerJanuary 5, 2004 at 8:24 am #764064If you select Debug | Compile (in the Visual Basic Editor, on a Win2000 machine), do you get an error message? If so:
– What is the exact message?
– What is highlighted when you click OK?
If you get a runtime error (on a Win2000 machine):
– What is the exact message?
– What is highlighted when you click Debug?(BTW, I removed the duplicate of your reply – you don’t need to repeat the same text in reply to several posts.)
-
WScw2
AskWoody LoungerJanuary 5, 2004 at 12:29 pm #764109I seem to be getting a bit closer to the solution.
The functions which do not work as far as I can tell all contain a reference to an activeX date picker control – Microsoft date and time picker, version 6.0 The file is called MSCOMCT2.OCX and in Windows 98 resides at c:/Windows/system. Since this control is not available in Windows 2000 I have replicated the directory/file structure and registered the control within access on the Windows 2000 PC.
The error message I get on the Windows 2000 PC is “runtime error 11” cannot divide by zero which suggests to me that it is unable to read the control possibly? But I don’t know how to rectify this.
An example of a rogue function is:
Public Function Per1000dateward()
‘Ctldatepickerto/from refers to an activeX control MSCOMCT2.OCX
Per1000dateward = 365 / ([Forms]![FrmWards].[CtlDatePickerTo] – [Forms]![FrmWards]![CtlDateFrom])
End Function -
WSHansV
AskWoody LoungerJanuary 5, 2004 at 12:41 pm #764111You say that you have registered mscomct2.ocx in Access, I assume that means that you have set a reference in Tools | References… But have you registered it in Windows? To do so, select Run… in the Windows Start menu, and type
regsvr32 c:windowssystem32mscomct2.ocx
then press Enter or click OK. Substitute the exact path where you put mscomct2.ocx.
-
WScw2
AskWoody LoungerJanuary 5, 2004 at 2:31 pm #764142Tried registering the MSCOMCT2.OCX control in Windows and it said it had done it successfully but this hasn’t cured the problem.
The error is saying “can’t divide by zero. On opening the form the control defaults to todays date and time. According to the function this would indeed give a zero reading i.e. today- today = 0
To get round this I have tried changing the default date value of the control but it doesn’t seem to want to stick. Besides, the value is the same as that on the Windows 98 PC which works fine.
Any other ideas – I feel we are getting close.
-
WSHansV
AskWoody Lounger -
WScw2
AskWoody LoungerJanuary 6, 2004 at 9:04 am #764432Problem solved…I think. The function which relates to a query which provides the detail for a subform meant that the subform could not work because on opening the main form the dates were exactly the same hence the “can’t divide by zero” message. I have no explanation as to why the exact same function works on one operating system and not the other. One of those many unsolved microsoft mysteries I guess. Thanks everyone for your suggestions.
Oh yes the work around was simply to put +1 next to one of the control references in the function. (with the data I am using this doesn’t distort the outcome).
-
WScw2
AskWoody LoungerJanuary 6, 2004 at 9:04 am #764433Problem solved…I think. The function which relates to a query which provides the detail for a subform meant that the subform could not work because on opening the main form the dates were exactly the same hence the “can’t divide by zero” message. I have no explanation as to why the exact same function works on one operating system and not the other. One of those many unsolved microsoft mysteries I guess. Thanks everyone for your suggestions.
Oh yes the work around was simply to put +1 next to one of the control references in the function. (with the data I am using this doesn’t distort the outcome).
-
WSHansV
AskWoody Lounger -
WScw2
AskWoody LoungerJanuary 5, 2004 at 2:31 pm #764143Tried registering the MSCOMCT2.OCX control in Windows and it said it had done it successfully but this hasn’t cured the problem.
The error is saying “can’t divide by zero. On opening the form the control defaults to todays date and time. According to the function this would indeed give a zero reading i.e. today- today = 0
To get round this I have tried changing the default date value of the control but it doesn’t seem to want to stick. Besides, the value is the same as that on the Windows 98 PC which works fine.
Any other ideas – I feel we are getting close.
-
WSHansV
AskWoody LoungerJanuary 5, 2004 at 12:41 pm #764112You say that you have registered mscomct2.ocx in Access, I assume that means that you have set a reference in Tools | References… But have you registered it in Windows? To do so, select Run… in the Windows Start menu, and type
regsvr32 c:windowssystem32mscomct2.ocx
then press Enter or click OK. Substitute the exact path where you put mscomct2.ocx.
-
WScharlotte
AskWoody Lounger -
WScharlotte
AskWoody Lounger
-
-
-
WScw2
AskWoody LoungerJanuary 5, 2004 at 12:29 pm #764110I seem to be getting a bit closer to the solution.
The functions which do not work as far as I can tell all contain a reference to an activeX date picker control – Microsoft date and time picker, version 6.0 The file is called MSCOMCT2.OCX and in Windows 98 resides at c:/Windows/system. Since this control is not available in Windows 2000 I have replicated the directory/file structure and registered the control within access on the Windows 2000 PC.
The error message I get on the Windows 2000 PC is “runtime error 11” cannot divide by zero which suggests to me that it is unable to read the control possibly? But I don’t know how to rectify this.
An example of a rogue function is:
Public Function Per1000dateward()
‘Ctldatepickerto/from refers to an activeX control MSCOMCT2.OCX
Per1000dateward = 365 / ([Forms]![FrmWards].[CtlDatePickerTo] – [Forms]![FrmWards]![CtlDateFrom])
End Function
-
WSHansV
AskWoody LoungerJanuary 5, 2004 at 8:24 am #764065If you select Debug | Compile (in the Visual Basic Editor, on a Win2000 machine), do you get an error message? If so:
– What is the exact message?
– What is highlighted when you click OK?
If you get a runtime error (on a Win2000 machine):
– What is the exact message?
– What is highlighted when you click Debug?(BTW, I removed the duplicate of your reply – you don’t need to repeat the same text in reply to several posts.)
WScw2
AskWoody LoungerViewing 1 reply thread -

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
-
Name of MS Word Formatting Feature
by
John Baum
2 hours, 31 minutes ago -
InControl Failure?
by
Casey H
3 hours, 14 minutes ago -
Microsoft : Free 1 year support for Windows 10 after EOL
by
Alex5723
1 hour, 38 minutes ago -
MS-DEFCON 3: Businesses must tread carefully
by
Susan Bradley
2 hours, 50 minutes ago -
McLaren Health Care says data breach impacts 743,000 patients
by
Nibbled To Death By Ducks
19 hours, 10 minutes ago -
WhatsApp banned on House staffers’ devices
by
Alex5723
14 hours, 12 minutes ago -
Is your device eligible?
by
Susan Bradley
22 hours, 9 minutes ago -
Windows 11 Insider Preview build 26200.5661 released to DEV
by
joep517
1 day, 4 hours ago -
Windows 11 Insider Preview build 26120.4452 (24H2) released to BETA
by
joep517
1 day, 4 hours ago -
Hello Windows…My Problem is Windows Hello…
by
rdleib
1 day, 5 hours ago -
New Canon Printer Wants Data Sent
by
Win7and10
1 day, 5 hours ago -
I set up passkeys for my Microsoft account
by
Lance Whitney
19 hours, 25 minutes ago -
AI is for everyone
by
Peter Deegan
1 day, 5 hours ago -
Terabyte update 2025
by
Will Fastie
23 hours, 31 minutes ago -
Migrating from Windows 10 to Windows 11
by
Susan Bradley
2 hours, 24 minutes ago -
Lost sound after the upgrade to 24H2?
by
Susan Bradley
2 days, 4 hours ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
8 hours, 10 minutes ago -
Plugged in 24-7
by
CWBillow
1 day, 14 hours ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
2 days, 17 hours ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
2 days, 15 hours ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
4 days, 8 hours ago -
Are Macs immune?
by
Susan Bradley
1 day ago -
HP Envy and the Function keys
by
CWBillow
3 days, 16 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
1 day, 10 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
4 days, 20 hours ago -
Unable to update to version 22h2
by
04om
2 days, 4 hours ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
5 days, 4 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
5 days, 4 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
4 days, 13 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
5 days, 17 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.