I developed a database in 2013 access since that is the version we use in the office. In that database is a lookup form where you enter the values of the for the item you want reports on. Basically I have a lookup table that all the queries and reports look to, you enter your look up value in the form text box, press the update buttons and the values in the lookup table will be changed. Below is the code used for that buttons.
Code:
Private Sub Command11_Click() Dim sql As String
sql = sql & "UPDATE Navigation_Entry "
sql = sql & "SET Area='" & Area.Value & "' "
sql = sql & "WHERE ID=0"
CurrentDb.Execute sql
End Sub
This works perfectly fine in 2013 but a co-worker opened the database in 2016 and it stated that an error occurred and the lookup form could not be loaded. If you tell it to close the form and continue opening, then you get an error saying the VBA is corrupted. At that point you have two options, delete all VBA in the database or if you tell it not to delete the VBA then the error message keeps popping up and you need to ctrl+shift+esc and end the process.
Couple of further comments to help;
- I took this file home and tested it on my personal computer that has 2016 and got the same errors.
- I have tried adjusting that trust center security settings to allow macros but it did not help.
- Probably that strangest thing is that I have 3 databases in total that use this same form with the exact same buttons (literally built the first one then copied and modified it to get the other two). The other two databases work fine on 2016. No errors loading or VBA corruption. Only difference between them is the three is that this one need 4 values for a lookup and the others only need 2 but I can't see why that would mess things up.