Custom Application, need help with modifying the Code for labels

Alright, I am not sure if anyone can really help me on this one but I figured I would give it a shot. Also, sorry ahead of time for the novel you might be about to read…I like to be thorough when asking for help/assistance, to me it makes the process a bit quicker when you get a lot of the potential questions out of the way in the beginning. Anyways, here is the breakdown of what I need help with.

At my company we use Epicor and Bartender, but in a very pieced together way that was set up years ago… We use a custom made label application, shown below.

The person who set up our custom label application within Epicor has since left. The issue I am facing is I am trying to integrate new customer labels into this application so the production floor has the ability to print them as they need them. Part labels are selected in the Part Maintenance application, as well as the data which populates on them (Shown below).

I have already successfully implemented two new ‘buttons’, one to populate the parts description (Pd button) and another to enter the date of manufacture (Md button). I have also sucessfully integrated the Part label into the application.

Now my issue however is the Bag/Box label. This part is proving to be a pain, I cannot seem to figure out how to make it work and I keep causing the application to crash or error out (Shown below).

Basically how the application is set up there is custom code that when the user has the label type ‘Bag & Box’ it triggers a text box to appear so the user can enter the total qty going into the box/bag. Once the user enters a qty in the text box, the grid displays what will print on the label. This custom code automatically add the word “QTY:” followed by the qty the user entered to the bottom of the bag/box label. The custom code also only allows 4 lines of code because it uses the last row for the qty. I have several issues with this. First, with the new customer I need to allow more than 4 Rows/lines to the grid and to print for the Bag & Box label. Second, I don’t want the word “QTY:” to appear on this customers label being this is already designed into the label.

I will warn you before you read on and go to the code below…it is a bit of a mess and I don’t know much about it, but it currently works. Also I should note, if it wasn’t clear at the beginning that I did not write this code or create this application. If any of this code is overkill, not to your liking, it bothers you, causes you discomfort, and/or makes you upset. I do apologize, but I do not know much about C# or Sql yet to do much about it. I am merely trying to modify this code and application it to function properly with my new labels (5 new labels). Being the person who actually created this is no longer with our company (he retired), I have decided to try and tackle it myself. All I have been doing is a lot of trial and error, which has proven to work in several cases. Just not with the Bag & Box Label. I am not sure what I need to modify in order for it to treat my new label as a separate entity, different from all the rest, hence the reason I am posting here today for a little help or guidance. If anyone can give some guidance or help me figure out what I need to modify to get the Bag and Box label to work that would be awesome.

Note: In the code you will see “//Bekka Added This”, those are all of my modifications I have added or tried in the code. Some of what I have tried is commented out and others actually worked so I kept them. Also the person who created it has many versions, so there is a lot of commented out code due to updates and changes. If you have some time and would like a slight challenge (to me it is a challenge at least), I would appreciate any assistance I could get with this. Please let me know if you need anymore information or if you have questions.
Label by jobs -Code.cs (157.9 KB)

I haven’t looked at the code yet, but your error is an array where you are asking for a value that doesn’t exist. It’s like a street with six houses on it and you want to know the color of the 7th house. Arrays are zero based, so the 6th house would be house[5] and the 1st would be house[0].
Look for the square brackets with a number (or sometimes a single letter) and perhaps you will find the problem.
If not, I can look over the code when I’m back at my PC.