Deleting a form with a Procedure


#1

I have a corrupt form and I am trying to remember how to delete a form with a procedure.

I have searched the help file and this forum for the code and come up short.

Any help would be appreciated.


#2

Use setformoptions with DELETE:

setformoptions "","My Form","DELETE",""


#3

Thank you Gary,

The form will not close or respond to your suggested code. It must be really corrupt. Any thoughts how to recover this database?


#4

What is “clcodese”? I just tested making a new form called “My Form” and ran the setformoptions "","My Form","DELETE","" code on it when it was open and then after recreating it I ran it again when it was closed and it deleted the form both times.

If the form can not be deleted or closed for some odd reason I would close the database and then reopen it to the datasheet only and then create a temp procedure with the above code altered to use your form name rather than the “My Form” as shown. To open it to only the datasheet you can use the Find & Open… item in the File menu and right click on the problem file which gives you a popup with the choice to Open Data Sheet Only.


#5

You should be able to delete a form with the View Organizer wizard. However, this uses the same setformoptions statement that Gary gave you.

As Gary suggested, I would try opening the database with the Data Sheet only, then use the View Organizer wizard to delete the form.

Before you do all that, though, if possible, I would be interested in a copy of this database for forensic examination. Maybe I can figure out what the problem is.


#6

“clcodese” is what you get when you double-click “close” and replace it with “code” except you actually only delete the “o” and replace it with “code”.


#7

Garys suggestion worked. I am thinking the corruption happens with tab panels. I am not sure if I am setting it up correctly. I was using tab panels with the following tab panel options.

    Data - vSubPanel1
    Forms - [Value]
    Default - empty
    Mode - formula

I had no formula entered in the formula tab. I was changing the variable vSubPanel1 with procedures and using showvariables.

I just changed this in the formula tab to use

?(catcherror("",vSubPanel1)<>"",vSubPanel1,"")

with the following options in tab panel options.

Data - vSubPanel1
Forms - vSubPanel1
Default - Empty
Mode - Formula

And Michael is correct about clcodese.