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

clebergyyn

New member
Local time
Today, 09:19
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
 
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.
 
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:
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.
 
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
 
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 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.
 
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
 
Isn't "Data Sheet" mode a Design Mode where you can do anything.

Try using Continuous mode instead.
 
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: 242
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.
 
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

Back
Top Bottom