How can you grey-out the 'Delete' option in the COLUMN right-click menu on a form? (1 Viewer)

high_low_jack

Registered User.
Local time
Today, 08:27
Joined
Nov 3, 2010
Messages
10
How can you grey-out the 'Delete' option in the COLUMN right-click menu on a Table?

I have a form with a table on it.

How can I grey-out the 'Delete' option in the COLUMN right-click menu on the Table?


Additional Info for my question:
I am aware that the following code will prevent a user from using the ROW right-click to delete a record in a table on a form:
Form.AllowDeletions = False
 
Last edited:

missinglinq

AWF VIP
Local time
Today, 08:27
Joined
Jun 20, 2003
Messages
6,423
The following code will prevent a user from using the ROW right-click to delete a record:
Form.AllowDeletions = True

Your post is somewhat confusing! You ask a question and then answer it...incorrectly!

Form.AllowDeletions = False

will gray out the Delete Record option!

Linq ;0)>
 

high_low_jack

Registered User.
Local time
Today, 08:27
Joined
Nov 3, 2010
Messages
10
I was providing information to my question...not answering it.

My question was on COLUMNS.....I was providing information on ROWS.
 

missinglinq

AWF VIP
Local time
Today, 08:27
Joined
Jun 20, 2003
Messages
6,423
Sorry I misunderstood you! But your post is still confusing!

There is no Delete Option on Columns in Access Forms, at least not thru version 2003. Are you speaking of Tables, perhaps, which do have such options?

Linq ;0)>
 

high_low_jack

Registered User.
Local time
Today, 08:27
Joined
Nov 3, 2010
Messages
10
Yes.

I have a Form with a Table on it.

How can you grey-out the 'Delete' option in the COLUMN right-click menu on a TABLE?
 

missinglinq

AWF VIP
Local time
Today, 08:27
Joined
Jun 20, 2003
Messages
6,423
The only way that I know to "have a Form with a Table on it" is to have the table as the source for a subform control on the form, and there is still no Delete Column option available. This is only available when simply running/viewing a table by itself.
 

high_low_jack

Registered User.
Local time
Today, 08:27
Joined
Nov 3, 2010
Messages
10
Yes the table is the source for a subform control on the form.

When I run the form and right-click the column header it gives me the option to "Delete" the column.

I want this greyed-out.
 

JANR

Registered User.
Local time
Today, 13:27
Joined
Jan 21, 2009
Messages
1,623
Why don't you just disable the whole shortcut menu in the load event of your form.

Code:
Private Sub Form_Load()
    Me.ShortcutMenu = False
End Sub

JR
 

boblarson

Smeghead
Local time
Today, 05:27
Joined
Jan 12, 2001
Messages
32,059
Or build your own with only the options you want.
 

missinglinq

AWF VIP
Local time
Today, 08:27
Joined
Jun 20, 2003
Messages
6,423
What version of Access are you running? Under versions 2000/2003, in this scenario, with a table used as the basis for a subform, there is no Delete Column option.

Are you sure you're not actually opening the table from the form, with something like

DoCmd.OpenTable "TableName"
 

high_low_jack

Registered User.
Local time
Today, 08:27
Joined
Nov 3, 2010
Messages
10
I am using Access 2010 - It only appears with Access 2010

I cant disable the whole menu because there are other options like 'Sort' that are needed in the menu.
 

high_low_jack

Registered User.
Local time
Today, 08:27
Joined
Nov 3, 2010
Messages
10
I am looking for a way to directly grey-out the default menu without creating a new menu.
 

boblarson

Smeghead
Local time
Today, 05:27
Joined
Jan 12, 2001
Messages
32,059
I am looking for a way to directly grey-out the default menu without creating a new menu.

If there was a way other than that, I would have told you. If you want it, you will have to build it. Sorry, sometimes it takes a bit of work to do things and this is one of them.
 

missinglinq

AWF VIP
Local time
Today, 08:27
Joined
Jun 20, 2003
Messages
6,423
If you create a Datasheet View form, based on your table, does the Delete Column option appear there on Right Click? If not, you could use this form instead of the table itself as the base for your subform.
 

high_low_jack

Registered User.
Local time
Today, 08:27
Joined
Nov 3, 2010
Messages
10
My next question is this:

If users can delete columns, How can I restore all deleted columns when the database is re-opened by the next user?
 

boblarson

Smeghead
Local time
Today, 05:27
Joined
Jan 12, 2001
Messages
32,059
My next question is this:

If users can delete columns, How can I restore all deleted columns when the database is re-opened by the next user?
As long as the form is closed without saving (not talking records here, but design changes), the column should be there again when you reopen the form.
 

Users who are viewing this thread

Top Bottom