You don't delete forms from the Visual Basic Editor.
To delete a from, right click on its name in the Navigation Pane, in your image, it's under All Access Objects on the left
Never noticed that option in the Vbe. I did some quick googling but haven't found any explaination for it.
What is that remove option for?
If this helped, please click the star * at the bottom left and add to my reputation- Thanks
Those are not forms. Those are the Class modules of the forms.
"If you set the HasModule property to No by using an object's property sheet or set it to False by using Visual Basic, Access deletes the object's class module and any code it may contain."
The command is also disabled for the class modules of reports.
As accesstos rightly says deleting the class module instantly deletes all code in that.
If that command were enabled it would be far too easy to delete all your code by mistake.
Many thanks guys for the help.Those are not forms. Those are the Class modules of the forms.
"If you set the HasModule property to No by using an object's property sheet or set it to False by using Visual Basic, Access deletes the object's class module and any code it may contain."
Where is the “object's property sheet”?
Open the form/report in design view - the property sheet should appear on the right of the screen. If not, click Property Sheet in the form Design ribbon
I'm aware of the consequences but what I was wondering is what that command is for? When is it enabled and why?
I couldn't find any explanation of it.
If this helped, please click the star * at the bottom left and add to my reputation- Thanks
It is enabled for standard modules and custom class modules. In these cases, VBE gives you the opportunity to save the item before removing it. I'm not sure, but I think that, for Form class modules, object dependency issues are involved, and an object that is member of an other object, must be removed through the parent object.
In property sheet, set the "Has module" to "No", confirm your choice in the relevant message and save the form.
Thanks. I suppose its termed "Remove" rather than "delete" as it does ask if you want to export it first. Never noticed it before (nor needed it)It is enabled for standard modules and custom class modules. In these cases, VBE gives you the opportunity to save the item before removing it. I'm not sure, but I think that, for Form class modules, object dependency issues are involved, and an object that is member of an other object, must be removed through the parent object.
If this helped, please click the star * at the bottom left and add to my reputation- Thanks
Thank you guys for the help
best
Jamal