Handle Error when opening form

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,486
I'm getting the following error as I try and open a Form from a command button.

"The expression On Current you entered as the event property sheet setting produced the following error; Db cannot find the referenced form: frmInventoryAddEdit.'

I originally created a form frmInventoryAddEdit and still use it, but I copied it and pasted it entirely naming it (the one that I'm getting the error on) as frmInventorySearchEdit.

After clearing the error via OK, the frmInventorySearEdit comes up and I can proceed, I'd just like to somehow do something in my from code like -- On Error Resume Next -- with a later On Error Goto 0.

Any advise appreciated.

Tks,

Jim
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Sounds like you still have some residual VBA code trying to reference the old one, probably in the Command Button, or in the Current Event of the Form you are opening.
Make the correction there, and the error should go away.

If you are not sure where to find, go into the VBA Editor and search your whole project for all instances of "frmInventoryAddEdit". Somewhere, you have it where it is not supposed to be.
 
Upvote 0
Joe - Thanks..
Both my frmInventoryAddsEdit and frmInventorySearchEdit contain a subform. I found the bad outdated reference in the On Current of it.

Jim
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top