Disable Tool-Bar Menu - 'Delete Record'

CarolW

Registered User.
Local time
Today, 15:35
Joined
Mar 24, 2006
Messages
58
Hello Everyone,
Before I pose my question I would first like to applaud and thank this forum for the excellent and timely help it has provided me so far. The assistance I have received to date, from you as members, and via the search facility has been extremely helpful particularly as I am new to this type of stuff…

My question is this...
I would like to disable users from selecting the 'Edit - Delete Record' facility from my main form upon its load. From searching the various forums I found a method upon which to disable the whole 'Edit' menu but not the specific 'Delete Record' function. Please accept my sincere apologies if this has already been posted but I simply cannot find it readily via a standard/refined 'search'. It might be the fact that I am phrasing the question incorrectly?? I don't want to severely restrict my users by disabling/hiding the whole menu but would rather limit them to accessing this option via a password protected command button?

What I have found so far.
Private Sub Form_Load()
CommandBars("Menu Bar").Controls("Edit").Visible = False
End Sub

Any assistance/guidance would be very much appreciated

Kind Regards – Best wishes to all of the registered site members

CarolW
:)
 
I suggest that you do hide the builtin menu bars and toolbars. The users should only have access to the controled functions you want to give them with either a custom toolbar or command buttons.
Hide all Access Toolbars and Menubars

You can prevent record deletions by turning the AllowDeletions property off.

These commands will allow you define what they can or can not do based on the True or False argument.

Me.AllowDeletions = True
Me.AllowAdditions = True
Me.AllowEdits = True

Check out the AllowAdditions Property in Access help for some more examples and options on how to control what your users can do. Use the forms OnOpen event when using these type of commands.
 
Last edited:
Disable Tool Bar Menu - 'Delete Record' Advise

Many Thanks Ghudson,
I will gladly take your advice and will give it a go on my DB when I next go into work. I hope you don’t mind but I have one further question to ask? My DB is in use and is working fine with about 6-9 users. With the exception of myself, all other personnel can only view it through Access 2000 runtime, which has been set up by our network administrators. Not a problem, or so I thought, until people around the office told me that they don't have the facility to e-mail via Access. The Send To menu is not available by selecting File – Send To that is causing me a bit of a headache? My DB is quite simple, nothing too complicated and the restoration of this facility either by the File Menu or via a right mouse-click whilst in Report Preview mode would be of enormous help to me. The bulk of our work is done via reports and they are great but I am getting frustrated with the inability to e-mail them. Can runtime be permitted to show this command even though it has not been installed by default by our IT teams?
If this is achievable then your help would be gratefully appreciated…….

Thanks for taking the time out to respond. Very much appreciated

CarolW:)
 
Carol -

To the point of your first question, the correct syntax for menu item manipulation is this:
Code:
CommandBars("Menu Bar").Controls("Edit").Controls("Delete Record").Visible = False

But I agree with ghudson, creating your own menus and toolbars is a better option. I'm not positive, but I believe the code above will affect the Access's built-in menu in any other database that you open with Access as well. :eek:

Sorry I don't have any experience with Access runtime to help you with your second question.

Jeff
 
The Access Runtime does not allow the use of the normal Access Toolbars and menubars.

Even though my users have the retail version of Access installed I still make them open my secured databases with the /runtime switch to help lock down the db.

You will have to create a custom command button [or routine] with the code to allow the users the SendTo option function. Search around for there are plenty of samples and code floating around.

The Access help files also have a lot of code and the correct syntax on how to use VBA once you figure out how to search for what you want.
 
Disable Tool-Bar/Access Runtime Feature(s)

Many Thanks Jeff & Ghudson for your excellent and timely advice.
I now understand the Access Runtime feature a ‘little bit better’ now and the fact that it “does not allow the use of the normal Access Toolbars and menu bars”, which I guess is understandable! I will follow your advice and will look around for the appropriate code to allow my users to use the ‘Send To’ function. One last thing - Do you think that I would still be able to ‘lock down’ my DB a little further, through runtime, so that it inhibits the Delete Record Facility – or might this action cause/introduce some problems or errors for me to deal with? Hopefully not bad one's?? With the exception of the lack of the ‘Send To’ option I am generally happy with all other menu options that runtime currently provides, but as previously mentioned I would simply like to stop users deleting record(s) unless they click a Password protected command button. Users can currently select this feature via the 'Edit' menu which would effectively render my proposed command button completely useless, as they would simply by-pass it.

Hope you both have a pleasant day. Thanks for your time........

Regards

Carol:)

Code Already Provided.
CommandBars("Menu Bar").Controls("Edit").Controls("Delete Record").Visible = False
 
The "AllowDeletions" code I gave you above is the best way to control the delete action but I also suggest that you create a custom Delete button for the user to click if and when you want them to be able to delete records. If the user has a record selected they can simply press the delete key on their keyboard to delete a record or press the Ctrl + X key combo to delete a record if you are not controling the function with code.

Check these links out for some working examples that will assist your project.

A Better Mouse Trap?

Enable/Disable The Control Box X Button

Hide all Access Toolbars and Menubars

Searching the forum is a great way to discover and learn the answers to your Access programming questions.
 
Questions & Answers relative to 'Tool Bar Menu - Delete Record'

Thank you Ghudson,
My apologies for not responding sooner....
I will most definately follow your advice and am I already looking at the working examples that you gave me. Many thanks for everything

Regards

CarolW
:)
 

Users who are viewing this thread

Back
Top Bottom