Results 1 to 10 of 10
  1. #1
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48

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

    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

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,540
    You could create a "accde" version which would prevent uses deleting the column
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    NTC is offline VIP
    Windows 10 Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    one of the features of the datasheet view is to allow users to do their own thing to a degree

    you can build a continuous form instead - and as BF noted also consider the ACCDE deployment

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    I would say it's not possible to delete a subform datasheet field/column without going into design view and deleting it. If that's what happened, then either a regular user was fooling around behind the scenes or an authorized developer deleted the control for the field. An accde should prevent the former, but not the latter since that person would have permissions to develop the base file.

    You can hide a column in datasheet view though, but that's not deleting. If that's what happened, an accde won't prevent it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,540
    Before I made my previous post l tried to delete a column from datasheet view and it was deleted. When I viewed in design view the control was no longer there but this deletion was not possible with the accde file.

  6. #6
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    I just tried and in view(not design) hitting delete button with a subform column highlighted did nothing(no delete). Cleb you do mean the column is gone or just the data in the column? Is the column still in the table, just not the subform?

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    Using 2010, if the form is viewed as datasheet in a .accdb, you can highlight and delete the column (or right click and select delete), and as Bob says, go to design view and the control is no longer displayed. However, if you do not then save the form, the column is 'undeleted'. Perhaps this is a feature that became available in 2010 and was not available in 2007?

    Personally I only provide users with a .accde so they can't mess with the forms, end of.

  8. #8
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Well, you learn something new every day
    I couldn't do it in 2007 and just assumed Microdaft wouldn't ever provide such a dangerous capability. Imagine that - now we have design control while in form view.

  9. #9
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    In 2010, in a datasheet view, if you right click on a column you get this shortcut menu - So not only can you delete a column, you can also add one that is missing - or add an existing one again.
    Click image for larger version. 

Name:	Capture.JPG 
Views:	24 
Size:	20.7 KB 
ID:	27537

    It is a behaviour I have noticed in the past, but didn't pay much attention because I do a lot of work with runtime which does not use the default shortcut menus - so I add my own in so users never actually see the default one.

  10. #10
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 05-04-2016, 11:09 AM
  2. Prevent data entry or deletion
    By mortonsafari in forum Forms
    Replies: 3
    Last Post: 02-01-2016, 01:10 PM
  3. Replies: 3
    Last Post: 08-18-2013, 09:14 PM
  4. Replies: 6
    Last Post: 11-21-2012, 05:10 PM
  5. Avoid column deletion in datasheet
    By dinorbaccess in forum Forms
    Replies: 6
    Last Post: 12-29-2010, 03:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums