Share via

User-defined type not defined errors on several form events

Anonymous
2019-07-08T23:55:51+00:00

An old .mdb file on Access 2013 on Win 10 1803.

We have an old .mdb file that we've been using since Access 2000. We started getting errors in Access 2013 (I asked another question about that), so I thought I would convert it to the new .accdb format and see what happens. The old file uses a custom .mdw file with security, so I created the new .accdb by first opening the .mdb with the proper .mdw, then creating a new .accdb, then copying all of the objects from the old one to the new one.

I then stripped out all of the security-related code from the .accdb. (There wasn't a ton, but there was some).

I then opened the .accdb and tried to open the first form.

I immediately get an error: "The expression "On Load you entered as the event property setting produced the following error: User-defined type not defined." Clicking OK on that error gives another identical one, this time for "On Current". Clicking OK on that one gives control to the form, but typing anything gives another identical error, this time for "On Key Down".

It's acting like it doesn't like the events themselves. I tried setting breakpoints at the first line in each of the three, and they never get tripped. The errors are occurring without the code actually being run.

There are no missing references. After I got the errors the first time, I checked the references. There were none showing as "missing", but there were three references that were checked in the original .mdb that weren't in the .accdb. I checked two of the three, with no change: the same errors still occur. I can't check the third (DAO 3.6), as apparently "Microsoft Office 15.0 Access database engine Object Library shown below" is meant to replace it. (Although, just as a note, both of them are checked in the .mdb file, but we didn't do that manually, they were both checked the first time we opened it in 2013.)

Further, there are no user-defined types in any of those three events. For example, the On Load event consists of a single "DoCmd.Maximize" command.

References checked are:

  • Visual Basic for Applications
  • Microsoft Access 15.0 Object Library
  • OLE Automation
  • Microsoft Office 15.0 Access database engine Object Library
  • Microsoft AccessX Data Objects 2.1 Library
  • Microsoft ADO Ext 2.8 for DDL and Security

Again, the errors occur with or without the last two being checked.

Searching for the error on the web usually suggests missing references, but I covered that above. If something else is missing, it doesn't show as missing, and I'm unaware of what it might be.

Any ideas?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2019-07-11T16:07:48+00:00

    Anyone?

    Was this answer helpful?

    0 comments No comments