MSAccess cannot find Form "XXX"

C

Clyde

An old procedure just stopped working, the first lines are:
Dim frmPop as form
Set frmPop = Forms!frmPopPayCC
Access error msg says "access cannot find frmPopPayCC". Of course it is
still there an can be opened from the database window.
In fact in the debug window I typed:
docmd.openform "frmPopPayCC" and of course it opened.
No references have been changed or deleted, this code is 4 or 5 yrs old.
BTW the second line is similar Set frm = Forms!frmTabs and it still works.
Mystery! Any suggestions would be greatly appreciated. Thanks
 
J

Jeff Boyce

Clyde

Which version(s) of Access? Is the application/db compiled?

Make (multiple) backup copies and try Compact & Repair (on one of them).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
C

Clyde

Never mind! I figured it out. I had moved the set statement. Moved it back
to after frm open and it worked. Never thought you had to have the form open
before a set frm to.
 
J

John W. Vinson

An old procedure just stopped working, the first lines are:
Dim frmPop as form
Set frmPop = Forms!frmPopPayCC
Access error msg says "access cannot find frmPopPayCC". Of course it is
still there an can be opened from the database window.

The Forms collection consists of all the *open* forms. A form that's not open
will not be included.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top