Identifying code attached to a control button

andy72685

Board Regular
Joined
Oct 20, 2016
Messages
72
I'm working with an Access form NOT designed by me that features an option to duplicate data on a new entry. We've been having trouble with this option being used incorrectly. Is it possible to identify the code associated with the button, in case removing the button also requires removing the code? Or, is it possible to see something in Design Mode with the 'Visible' property set to 'No'? I'm hoping that any action taken would only be temporary, and I don't want to destroy the functionality of the program.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Andy, I don't know if this helps because I don't use access but it might be the same as excel. In excel you can right click the button - choose assign macro. A window should pop up. In the top window is the macro assigned to the button.
 
Upvote 0
Open the Form in Design Mode and select the Control Button.
View the Properties of this Control Button.
If you do to the Event tab, it will show you what is called on different events involving the button (i.e. Clicking it). If you see something in the "On Click" property, clicking on the "..." button in that box will bring up the VBA code behind the box.

If you would just like to temporarily disable this button, go to the Data tab in Properties, and set the Enable property to No. Then the Control and VBA code will still be there, but the Control will be grayed out and unable to be selected or run. So that will temporarily disable it for you without removing anything.
 
Upvote 0
Andy, I don't know if this helps because I don't use access but it might be the same as excel. In excel you can right click the button - choose assign macro. A window should pop up. In the top window is the macro assigned to the button.
No, Access is quite a different beast than Excel (many people think it as an extension of it, but it is not, it is something quite different).

If you click on the Control in Design Mode, you will see an option for Properties. If you click on that, it will get you into the Properties, and then you can follow the instructions I posted in the previous post.
 
Upvote 0
Excellent! Thanks Joe4. Temporary graying should be perfect until we get everyone up to speed!
 
Upvote 0
You are welcome!
Glad I could help.
 
Upvote 0
As a secondary question, would disabling the control button on one terminal affect the entire DB, or just the local setup?
 
Upvote 0
It depends.

Are you working from a split database?
In a split database scenario, typically you have all your data on one central back-end database on the network, and each user has their own copy of the front-end, which contains Queries, Forms, Reports, Macros, and VBA code. If you have this scenario, you would only be affecting the local copy of the front-end (unless you distribute a new copy to all your users).

By the way, splitting your database is recommended in a multi-user environment. In reduces the chance of corruption and other issues with users in the same copy at the same time.
See: https://support.office.com/en-us/ar...database-3015ad18-a3a1-4e9c-a7f3-51b1d73498cc
 
Upvote 0
I'm not sure. It's located on a shared drive, and the records made on other terminals are not visible unless specifically searched for, but the iteration for each 'Next' record is assigned when a new record is created on ANY machine. In other words, I can enter something at 25642, and the next one I enter could be 25927, depending on what the other users are doing.
 
Upvote 0
The question is really - are all the users opening and using the same single access file. You probably don't know what a split database is. In a split database, each user has their own Access file that has the forms and queries in it - these are just ways to connect to the the database. Think of it like an interface, or like shopping at Amazon.com on your web browser. The data is all stored in one single backend file that is what everyone is connecting to. Think of it as the huge amazon.com database that you are sending your orders to.

If you don't have an Access file on your machine then you probably don't have a split database, so any changes made to the shared database on the shared drive apply to everyone immediately (and by the way, cannot be made unless you kick everyone out first).
 
Upvote 0

Forum statistics

Threads
1,221,787
Messages
6,161,960
Members
451,734
Latest member
Anmol Pandey19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top