stop deleting column from the Form RRS feed

  • Question

  • I have  created a form which shows 100 students detail in on page. there are 4 columns with student details. I want these columns editable but when I  select one of the column and deleted the column. it is deleted.  eg:

    sid    sname     class    Country

    1      sam        8          usa

    2     krish        9          england

    3     John         5         france

    So can someone advice me how to stop users to delete the column but then can edit it. Thanks in advance

    • Edited by kesharlal Wednesday, February 21, 2018 1:04 AM
    Wednesday, February 21, 2018 1:04 AM

All replies

  • Hi,

    I'm not sure if I can understand your question/situation. So, let me confirm:
    (1) Are you using Access VBA, or other language (e.g. C#, VB.NET)?
    (2) What do you mean by "deleted the column"?  I guess it means "deleted value/data in a cell". Is this correct?



    Wednesday, February 21, 2018 1:40 AM
  • Are you using a datasheet form? If so, try right-clicking on the column header and select Unhide Columns. Otherwise, don't use datasheet. Instead, use a Continuous Form.

    Hope it helps...

    Wednesday, February 21, 2018 3:29 AM
  • I wasn't aware of this phenomenon, but I've done some experimenting.  It seems to be a result of having Layout View enabled (even though the form is opened in datasheet view) -- if the current database's Enable Layout View option is checked (in the File -> Options -> CurrentDatabase page), and the form's Allow Layout View property is set to Yes (on the Format tab of the form's property sheet in design view), then you can actually delete a whole column from the form when it is in datasheet view, by selecting the column and pressing the Delete key or right-clicking it and choosing "Delete".

    To prevent it, you can either turn off the Enable Layout View option for the entire database, or set the form's Allow Layout View property to No.  Then the column can't be deleted from the form in this way.

    Dirk Goldgar, MS Access MVP
    Access tips:

    Wednesday, February 21, 2018 4:36 AM
  • Hi Dirk,

    Thanks for the tip!

    Wednesday, February 21, 2018 3:56 PM
  • sorry for confusing question. It is in access. I mean to say when I select the whole column and delete it. it delete all column. eg sname column. not only the value or data but all the column. So I want to prevent it to be deleted by the user. but want to give access to edit the cell.
    Wednesday, February 21, 2018 4:34 PM
  • Wow.. thank you sir it worked perfectly. solved :) 

    Wednesday, February 21, 2018 4:43 PM
  • thank you Dirk suggestion worked. :)
    Wednesday, February 21, 2018 4:44 PM
  • thank you Dirk suggestion worked. :)
    Wednesday, February 21, 2018 4:44 PM
  • Thanks to all
    Wednesday, February 21, 2018 4:45 PM
  • Hi kesharlal,
    If your issue is resolved, please mark as answer on the post which helped you.
    I suppose it would be Dirk Goldgar's post.


    Thursday, February 22, 2018 4:07 AM