Ok so I've been asked by my work to create an Access database and I've been patching it together the best I can mostly by being carried by people on this forumn. While I've been putting in macros and some customized VBA code I have never fully understood how that works.
I have a report. Click design view and view code in the design tab of the report design tools. This takes me to a Visual Basic for Applications area where all the macros on that report are shown in VBA code. However, it doesn't appear that I can add to that code by following the rules of the other macros.
For example, every macro uses
Private Sub Command159_Click () as the identifier (159 is one of many command numbers that coorespond to macros created on the report). I created a new button (its number is 164) and followed the same format as another macro by copying and pasting its code below the End Sub and replacing the numbers with the new number (164). But Access is giving me an Identification error. I've been able to get around understanding how the VBA module works by creating a macro that is structurally similair to the custom macro I want and converting everything before going through and deleting repetition. Unfortunately, this sometimes creates errors with other macros because of "EVENT PROCEDURE." Thus, recently I have not been able to update any of the custom macros I made on this report.
I'm getting pretty frustrated with not knowing how VBA code works so if someone could explain the afformentioned problems it would be really helpful. Thank you so much!