How to prevent (lock) the deletion of a column in a subform in Datasheet view? (1 Viewer)

clebergyyn

New member
Local time
Yesterday, 22:04
Joined
Feb 16, 2017
Messages
25
Hello friends. I have a problem. Does anyone know how to prevent (block) deleting a column in a subform in Datasheet view? A user accidentally deleted a column from a subform in "data sheet" mode. What to do to prevent?

I hope and, thank you in advance
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:04
Joined
Feb 28, 2001
Messages
27,254
First, ... OUCH.

Second, your problem is that you are allowing users to see the form in design mode. Please use the forum's Search feature for the topic "Securing a Database," which should give you a bucket-load of articles on how to turn off design view for production databases.

THAT is how you prevent the situation you just described. In essence, you will find that you NEVER give that level of access to users. (You just found out why the hard way.) Once you have read over those articles, you might indeed have more questions, but at least you will have a better foundation for why you don't let folks see ANYTHING in design view.
 

clebergyyn

New member
Local time
Yesterday, 22:04
Joined
Feb 16, 2017
Messages
25
Friend, test yourself, it is not in design mode, it is in "data sheet" mode of a subform, you select the column and click "delete", it excludes the column. It's as if you were deleting a field from the table, but it's from the subform. Take the test there.
 
Last edited:

MarkK

bit cruncher
Local time
Yesterday, 22:04
Joined
Mar 17, 2004
Messages
8,186
But what gets deleted? If after deleting this column, as you say, now when you put the form in design view, is the field still deleted?

I just made a datasheet form here. There is no functionality to delete a column. Also I can highlight a column and hit the delete key. Nothing happens.
 

clebergyyn

New member
Local time
Yesterday, 22:04
Joined
Feb 16, 2017
Messages
25
Create a form with a subform in "data sheet" mode, when opening in normal mode, click to select a column in the subform (datasheet mode) and click delete, which will delete the column, take the test
 

missinglinq

AWF VIP
Local time
Today, 01:04
Joined
Jun 20, 2003
Messages
6,423
Create a form with a subform in "data sheet" mode, when opening in normal mode, click to select a column in the subform (datasheet mode) and click delete, which will delete the column, take the test

Sorry, doesn't work for me, either! You can select a Column and click on 'Hide' and it will do just that, but you can't Delete a Column, in anything except Design View...at least up to v2007.

Linq ;0)>
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:04
Joined
Feb 28, 2001
Messages
27,254
The ONLY place where a true DELETE works on a column is in design view. Something else is going on and it is going on because your users can't be trusted to not futz around with the database. You need to hide things from them; treat users like babies and baby-proof the app to prevent curious fingers from poking around where they don't belong.

Linq's comments about HIDE are particularly appropriate. You should be able to use the UNHIDE feature to recover that column. But that event implies that you have NOT split the database and that your users are sharing it directly. Search this forum for articles on splitting databases into front-end and back-end components and see how to protect your code and data. Your problem is incorrect or careless deployment of whatever it is that you have for your users.
 

clebergyyn

New member
Local time
Yesterday, 22:04
Joined
Feb 16, 2017
Messages
25
In the subform (data sheet mode) deletes yes, it is very strange indeed, if you select the column and click delete delete, it's as if you were deleting the subform field. But, okay, in the accde version it does not allow deletion, I'll go using it like this
 

TheGhostOfRain

Registered User.
Local time
Today, 15:04
Joined
Jun 19, 2016
Messages
10
Isn't "Data Sheet" mode a Design Mode where you can do anything.

Try using Continuous mode instead.
 

JANR

Registered User.
Local time
Today, 07:04
Joined
Jan 21, 2009
Messages
1,623
In Access 2010 accdb I can delete a Column/Field even in form view by right clicking the column and choose delete, or simply press the delete button. I suspect this for the developer to quickly remove a field you don't want instead of going into designmode of the form.

To undo this action, just close the form without saving it and all is back to normal. :rolleyes:

But as suggested the feature is removed from accde or runtime applications.

JanR
 

Attachments

  • DatasheetDelete.jpg
    DatasheetDelete.jpg
    69.6 KB · Views: 185

clebergyyn

New member
Local time
Yesterday, 22:04
Joined
Feb 16, 2017
Messages
25
Friends, I figured out how not to let go. We have to go in the "options" menu, and disable the "enable layout mode" and also disable the "enable design changes ..."

Thank you all and good studies.
 

oday

New member
Local time
Today, 08:04
Joined
Apr 5, 2024
Messages
7
Friends, I figured out how not to let go. We have to go in the "options" menu, and disable the "enable layout mode" and also disable the "enable design changes ..."

Thank you all and good studies.
thank you dear ... it solf my proplem ... 🙏
 

Users who are viewing this thread

Top Bottom